Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

unity coroutine

void Start() {
  StartCoroutine("func"); // Start coroutine named "func"
}

IEnumerator func() {
  Debug.Log("Hello");
  yield return new WaitForSecondsRealtime(1); //Wait 1 second
  Debug.Log("World");
}
 
PREVIOUS NEXT
Tagged: #unity #coroutine
ADD COMMENT
Topic
Name
3+6 =