When I want to make a public container (e.g. Array/List) of a class, I always want that the values of the class be the same as I declared in the script.
Of course, I can edit those variables in the inspector to match them again, but it is just annoying setting all the variables back to the values of the declaring section from the class.
For Example:
public class TeamManager : MonoBehaviour {
[System.Serializable]
public class Team {
public string name = "NEUTRAL";
public Color color = Color.white;
public Sprite icon;
public int unitsLeft = 100;
public List<MainAgent> agentsPrefabs;
public List<MainAgent> activeAgents;
}
public List<TeamManager.Team> teams;
}
The result is that “color” is cleared, “name” is an empty string and “unitsLeft” is 0.