Exemplo 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);
        }
Exemplo n.º 2
0
 public EnemyManager(EnemyControllerView enemyPrefab, MapManager mapManager)
 {
     this.mapManager          = mapManager;
     this.enemyPrefab         = enemyPrefab;
     gameManager              = GameManager.Instance;
     gameManager.onGameReset += Reset;
 }
Exemplo n.º 3
0
 public void DestroyEnemy(EnemyControllerView enemy)
 {
     enemies.Remove(enemy);
     gameManager.UpdateScore(5);
     if (enemies.Count == 0)
     {
         gameManager.GameOver("You Won");
     }
 }