Пример #1
0
    private void OnGameplayStarting()
    {
        IEnumerator StartSequence()
        {
            if (KillAllUnits())
            {
                yield return(new WaitForSeconds(1f));
            }

            spawner.SpawnAllUnits();
            fightController.enabled = true;
        }

        StartCoroutine(StartSequence());
    }
Пример #2
0
 /// <summary>
 /// Adds a unit spawneer to the current instance, and spawns the maximum allowed number of units.
 /// </summary>
 /// <param name="unitSpawner">UnitSpawner object to add.</param>
 public void AddUnitSpawner(UnitSpawner unitSpawner)
 {
     unitSpawners.Add(unitSpawner);
     unitSpawner.SpawnAllUnits();
 }