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); }
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); }
public void OnDie(EnemyDestroyType type) { enemySpawner.DestroyEnemy(type, this, gold); }
public void OnDeath(EnemyDestroyType type) { enemySpawner.DestroyEnemy(type, this, credit); }