Ejemplo n.º 1
0
 private void EnsureSingleton()
 {
     if (_instance == null)
     {
         _instance = this;
     }
     else if (_instance != this)
     {
         Destroy(gameObject);
     }
 }
Ejemplo n.º 2
0
        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;
                }
            }
        }