Skip to content

Instantly share code, notes, and snippets.

@mindlace
Created September 2, 2011 07:17
Show Gist options
  • Save mindlace/1188090 to your computer and use it in GitHub Desktop.
Save mindlace/1188090 to your computer and use it in GitHub Desktop.
working yield return
using UnityEngine;
using System.Collections;
public class YieldTest : MonoBehaviour {
public IEnumerator Do() {
print("Do now");
yield return new WaitForSeconds(2);
print("Do 2 seconds later");
}
public void Awake() {
StartCoroutine("Do");
print("This is printed immediately");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment