Esempio n. 1
0
        public void SpawnEnemy()
        {
            EnemyControllerView enemy = GameObject.Instantiate(enemyPrefab.gameObject, mapManager.GetRandomSpawnPosition(), Quaternion.identity).GetComponent <EnemyControllerView>();

            enemy.SetManager(this, mapManager);
            enemies.Add(enemy);
        }
Esempio n. 2
0
 public EnemyManager(EnemyControllerView enemyPrefab, MapManager mapManager)
 {
     this.mapManager          = mapManager;
     this.enemyPrefab         = enemyPrefab;
     gameManager              = GameManager.Instance;
     gameManager.onGameReset += Reset;
 }
Esempio n. 3
0
 public void DestroyEnemy(EnemyControllerView enemy)
 {
     enemies.Remove(enemy);
     gameManager.UpdateScore(5);
     if (enemies.Count == 0)
     {
         gameManager.GameOver("You Won");
     }
 }