private void EnsureSingleton() { if (_instance == null) { _instance = this; } else if (_instance != this) { Destroy(gameObject); } }
private void Start() { spawnController = SpawnController.Instance; if (spawnController.RandomPaths) { Transform[] possiblePaths = spawnController.PossiblePaths; foreach (WaveComponent wc in waveComponents) { int pathPos = rand.Next(0, possiblePaths.Length); Transform chosenPath = possiblePaths[pathPos]; Debug.Log("The chosen path for " + wc.EnemyPrefab + " is " + chosenPath); wc.WaypointsParentGO = chosenPath; } } }