public void addEnemy(EnemyPlaneScript anEnemy) { if (_enemyPlanes.Contains(anEnemy)) { Debug.Log("Attempting to re-add enemy"); } else { _enemyPlanes.Add(anEnemy); Debug.Log("Added enemy plane"); } }
public void removeEnemy(EnemyPlaneScript anEnemy, bool hasDied) { if (_enemyPlanes.Contains(anEnemy)) { _enemyPlanes.Remove(anEnemy); Debug.Log("Removed enemy plane"); } else { Debug.Log("Attempting to remove non-existing enemy"); } if (hasDied) { _score++; scoreText.text = _score.ToString () + " / " + _numPlanes.ToString (); if (_score == _numPlanes) { gameOver.text = "Game Over\nYou Win!"; gameOver.gameObject.SetActive(true); } } }