Ejemplo n.º 1
0
 public void DestroyEnemy(EnemyDestroyType type, Enemy enemy, int gold)
 {
     if (type == EnemyDestroyType.Arrive)
     {
         playerHP.TakeDamage(1);
     }
     else if (type == EnemyDestroyType.Kill)
     {
         playerGold.CurrentGold += gold;
     }
     currentEnemyCount--;
     enemyList.Remove(enemy);
     Destroy(enemy.gameObject);
 }
Ejemplo n.º 2
0
 public void DestroyEnemy(EnemyDestroyType type, Enemy enemy, int credit)
 {
     //If the enemy has arrived to the base, take off 1 from playerHealth
     if (type == EnemyDestroyType.Arrive)
     {
         playerHealth.TakeDamage(1);
     }
     else if (type == EnemyDestroyType.kill)
     {
         creditManager.Credits += credit;
     }
     //Deleting the enemy from the list when it dies
     enemyList.Remove(enemy);
     //Deleting the enemy object
     Destroy(enemy.gameObject);
 }
Ejemplo n.º 3
0
 public void OnDie(EnemyDestroyType type)
 {
     enemySpawner.DestroyEnemy(type, this, gold);
 }
Ejemplo n.º 4
0
 public void OnDeath(EnemyDestroyType type)
 {
     enemySpawner.DestroyEnemy(type, this, credit);
 }