//When a new scene is loaded, all enemies register themselves with the game manager. //Register functions might be called in any order, so anything that depends on // multiple types of entity will need to be checked in each relevant function. public void RegisterEnemy(Enemy newEnemy) { enemies.Add(newEnemy); if (exit != null) { exit.Close(); } }
//When a new scene is loaded, the exit registers itself with the game manager. //Register functions might be called in any order, so anything that depends on // multiple types of entity will need to be checked in each relevant function. public void RegisterExit(Exit newExit) { exit = newExit; if (enemies.Count > 0) { exit.Close(); } }