unity when to use serializefield code example
Example 1: unity serializefield
//Shows the private variable in the Unity Inspector
[SerializeField]
private string name;
Example 2: unity no serializefield
[System.NonSerialized]
public int Num = 5;