Complete the code to make the variable visible in the Unity Inspector.
public class Player : MonoBehaviour { [1] int health = 100; }
Using public makes the variable visible and editable in the Unity Inspector.
Complete the code to keep the variable private but still show it in the Unity Inspector.
public class Enemy : MonoBehaviour { [1] int damage = 50; }
The [SerializeField] attribute makes a private variable visible in the Inspector.
Fix the error in the code to correctly serialize a private variable.
public class Weapon : MonoBehaviour { [1] int ammoCount = 30; }
The [SerializeField] attribute must be placed in square brackets before the variable declaration.
Fill both blanks to declare a private variable visible in the Inspector and initialize it.
public class Shield : MonoBehaviour { [1] int [2] = 75; }
Use [SerializeField] to show the private variable shieldStrength in the Inspector.
Fill all three blanks to declare a private serialized float variable with a default value.
public class SpeedBoost : MonoBehaviour { [1] float [2] = [3]; }
The variable boostSpeed is private but visible in the Inspector with [SerializeField] and initialized to 5.5f.