Hello,
function NotDamaged()
{
yield WaitForSeconds(0.3);
indicateDMG=false;
for(var i=15; i>0; i--)
{
intTimeLeft = i;
yield WaitForSeconds(1);
}
notDamaged=true;
}
OnGUI()
{
if((!notDamaged) && (intTimeLeft>0))
{
GUI.Box(Rect(200, 5, 50, 25), "" + intTimeLeft);
}
}
I call function NotDamaged each time i am wounded or i cast a spell. And now when this function is called twice or more times intTimeLeft in OnGUI starts changeing from one number to other. What I want to do is somehow kill function NotDamaged which is called first and let continue just for the last called NotDamaged function.
Can someone help? Thanks.