Hey guys…
To be honest, I don´t wuite understand how a coroutine works… so if any of you want to tell me where should I look to learn, it would be great…
Anyway…it seems I am missing something, here, for the GUILabel to blink…
Can you help me out, please?
void BuyContinues()
{
if (gold >= 6)
{
continues = continues + 1;
}
else
{
StartCoroutine (FlashLabel());
}
}
IEnumerator FlashLabel()
{
while (true) {
displayLabel = true;
yield return new WaitForSeconds(1);
displayLabel = false;
yield return new WaitForSeconds(1);
}
}
in my OnGUI I have that if displayLabel is true, then the GUILabel is set
if (displayLabel == true)
{
GUI.Label(new Rect(Screen.width * 0.01f, Screen.height * 0.7f, Screen.width * .6f, Screen.height * .2f), "BUY GOLD FIRST ", STOst);
}