// Update is called once per frame
 void Update()
 {
     if (UnitTracker.GetActiveEnemyCount() == 0)
     {
         if (bossSpawned == false)
         {
             UnitSpawner.SpawnUnitsInArea(UnitReferences.EnemyBattleship, 1, enemySpawns[3]);
             bossSpawned = true;
         }
         else
         {
             GameController.Instance.PlayerVictorious();
         }
     }
     if (UnitTracker.GetActiveEnemyCount() < 20 && enemiesKilled < 20)
     {
         int randomSpawn       = Random.Range(0, 2);
         int tempEnemiesKilled = 20 - UnitTracker.GetActiveEnemyCount();
         UnitSpawner.SpawnUnitsInArea(UnitReferences.EnemyFighter1, tempEnemiesKilled, enemySpawns[randomSpawn]);
         enemiesKilled += tempEnemiesKilled;
     }
     if (UnitTracker.GetActiveAllyCount() < 10 && alliesKilled < 15)
     {
         int randomSpawn   = Random.Range(0, 2);
         int temAllyKilled = 10 - UnitTracker.GetActiveAllyCount();
         UnitSpawner.SpawnUnitsInArea(UnitReferences.AlliedFighter1, temAllyKilled, allySpawns[randomSpawn]);
         alliesKilled += temAllyKilled;
     }
 }
 void CheckForWin()
 {
     if (UnitTracker.GetActiveEnemyCount() == 0 && UnitTracker.PlayerShip != null && TimerController.Instance.GetTime() > 0 && currentProgressionPoint == 2)
     {
         HUDController.Instance.DisplayMessage("You win.");
     }
 }
Beispiel #3
0
 protected override void UnitDeath()
 {
     if (UnitTracker.GetActiveEnemyCount() == 0)
     {
         AdvancePhase();
     }
 }
 protected override void UnitDeath()
 {
     if (UnitTracker.GetActiveEnemyCount() == 0 && !bossSpawned)
     {
         UnitSpawner.SpawnUnit(UnitReferences.EnemyBattleship, new Vector3(0, 100, 200));
         bossSpawned = true;
     }
 }
 // Update is called once per frame
 void Update()
 {
     HUDController.Instance.SetObjectiveCount(UnitTracker.GetActiveEnemyCount());
 }