When the button is pressed, the time goes off (5 minutes), but if another button was pressed (terminating IEnumerator), the time stops and if the button is pressed again, then the time goes on, so also that after 5 minutes “enum” changes to the next
public enum MonthEnum { Undefined, January, February, March, April, May, June, July, August, September, October ,November, December }
public void OnClickStart()
{
StartCoroutine ("Month");
}
public void OnClickEnd()
{
// Remember time of stop
StopCoroutine("Month");
}
IEnumerator Month()
{
while (true)
{
// i dont know how to change enum to next
yield return new WaitForSeconds(300.0f); // and i dont know how to remember the time of OnClickEnd and continue OnClickStart
}
}