Hello all,
I am calling my function enterFlightMode which I am trying to make last ten seconds. 1 second per iteration. Heres the code.
IEnumerator oneSec()
{
yield return new WaitForSeconds (1.0f);
}
void enterFlightMode()
{
Debug.Log ("Entered Flight mode");
for (int i = 10; i > 0; i--) {
flightText.guiText.text = "FLY! " + i;
StartCoroutine( "oneSec" );
}
flightText.guiText.text = "";
flightEnabled = false;
jumping = true;
Debug.Log ("Exited Flight mode");
}
Essentially I want the two Debug.Log statements to execute 10 seconds apart; Each second changing my guiText.
I hope this is enough information let me know if you guys need more.
Thanks in advanced
P2
PS. I have tried a simple function call without StartCoroutine, but im not too sure of the difference
↧