Sup everyone, does calling a method once in update safe?
So basically I have a conditional statement inside Update that checks if the player is dead then I want to call an event and execute subscribed methods of it
private bool isDead = false;
if(health < 0.01f && !isDead){
GameEvents.i.PlayerIsDead();
isDead = true;
}
Something like that, is this safe? Safe in a way that it doesn’t cost performance issue.
I’m making an android game btw, sorry for this stupid question hope you understand