Well here is a script where i try to add an effect to game that makes player see how score is added.... There is only one way how to add to real score - using tempScore which is temporary score where all numbers are stored if an event has happened.
My question: is there a way to make this work with better performance and as a better visual effect for potencial player?
Thanks for support!
Code goes here:
function Update()
{
if(tempScore<=0)
{
if(tempScore<0) tempScore=0;
scoreNumberTxt.text=""+score;
tempTxt.text="";
}
else
{
AddScore();
}
}
function AddScore()
{
while(tempScore>0)
{
scoreNumberTxt.text=score+"";
tempTxt.text="+"+tempScore;
yield WaitForSeconds(0.35);
tempScore--;
score++;
}
}
↧