Синтаксис:
Используется csharp
public bool bonus;
public void OnGUI () {
if (bonus) {
Bonus b = GetComponent<Bonus>();
GUI.Box(new Rect(Screen.width/2-30,Screen.height/2-15,60,30),"+" + b.bonusSize.ToString());
Yields (2);
bonus = false;
}
}
IEnumerator Yields (float timer) {
yield return new WaitForSeconds (timer);
}
public void OnGUI () {
if (bonus) {
Bonus b = GetComponent<Bonus>();
GUI.Box(new Rect(Screen.width/2-30,Screen.height/2-15,60,30),"+" + b.bonusSize.ToString());
Yields (2);
bonus = false;
}
}
IEnumerator Yields (float timer) {
yield return new WaitForSeconds (timer);
}
Что не так? У меня вообще не показывается окно.