Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Hey! It should be relatively simple. When you spawn enemies in a room, keep track of which enemies you spawned, for example in an array. Now in your room manager class, you want to have a method e.g. void OnEnemyDefeated(GameObject enemy) that will be called when an enemy is defeated. Inside the method, you will remove the enemy from the array of all enemies that were spawned in the room. And if there are no enemies left in the array, that means that there are no living enemies in the room, so you can open the doors. The last thing to handle is calling the method when an enemy is defeated. I presume that you have access to the health of each enemy so if the health of the enemy equals to 0, you call the OnEnemyDefeated method with the enemy that was defeated. 

Let me know if you have any additional questions!

Hello, I do have a couple of more questions, is there anywhere I could direct message you? Thanks!

You can write me an email at ondra@nepozitek.cz or create an issue on github (https://github.com/OndrejNepozitek/Edgar-Unity/issues)