Structuring a damage and kill count method...

I had an issue thinking this up: what is the most effective way to add to a kill counter when an enemy’s health reaches zero? I have about 20 enemies in a scene - how would I be able to do this?

Please, this is not a request for labor, so do not go on about down-voting. And also consider that my work is all in c#.

Thanks in advance!

Make a gameobject that will have your kill count script (or put the script on any other object that is not being destroyed).

In the kill count script, just have a public int for the kill count.

Then in your enemy script, add the following lines right before you destroy your enemy:

GameObject.Find("GameObjectName").GetComponent<KillCountScriptName>().KillCountVarName ++;

I think that should work.