protected override void Awake() { if (instance != null) { throw new System.Exception("Multiple RTSManager instances in the scene. You should only have one."); } instance = this; units = new RTSUnitManager(); units.Awake(); players = new RTSPlayer[3]; for (int i = 0; i < players.Length; i++) { players[i] = new RTSPlayer(); players[i].index = i; } }
void OnDestroy() { units.OnDestroy(); instance = null; }