So basically i have this shooting game where when targets get shot 3 times the game object for the target is deactivated but in another script i want it to know when each target is deactivated so that i can add one to the score. I got that to work except since each target is deactivated and stays deactivated it continuously adds one every update for every deactivated target. I currently have it set up as an array of targets in the script and every update it sees if the target is deactivated, if so it adds one to the score but it never stops.
private void Score()
{
for (int i = 0; i < Targets.Length; i++)
{
if (!Targets*.activeInHierarchy)*
{
score++;
}
}
}