Game Development Reference
In-Depth Information
StartCoroutine("DoSomething", 5.0f);
// Wait for 2 seconds
yield return new WaitForSeconds(2.0f);
// Stop Coroutine DoSomething
StopCoroutine("DoSomething");
}
IEnumerator DoSomething (float someParameter) {
while (true) {
// DoSomething Loop
Debug.Log ("DoSomething Loop = " + Time.time);
// Yield execution of this coroutine and return to the
main loop until next frame
yield return null;
}
}
Search WWH ::




Custom Search