Hello,
So I'm using this techique to update my score. I never had any troubles with it, but this occured in a previous project of mine. I fixed it there by replacing the new UI with a GUIText, which did the trick, but for this project I can't use a GUIText.
So basicly what happends is when the player gets a score point and I update the UI, the game skips or laggs for a few frames. It doesn't load, it skips. Which is VERY annoying for the player!
Code is very basic:
void OnTriggerEnter2D(Collider2D col)
{
if (col.transform.tag == "Point")
{
JumpCarGameController.Instance.AddScore();
}
}
inside JumpCarGameController is following method:
public void AddScore()
{
score++;
GlobalGameGUI.Instance.UpdateScoreText(score);
}
And in GlobalGameGUI:
public void UpdateScoreText(int score)
{
inGamescoreText.text = score.ToString();
}
"inGamescoreText" is a text object of the new UI (since 4.6) unity, I linked it in the inspector like this:
![alt text][1]
Only happends on IOS, not in editor or android, also tested with multiple projects started froms scratch. Reinstalled unity twice but here I still am.
[1]: /storage/temp/44276-capture.png
↧