Created
September 2, 2011 07:17
-
-
Save mindlace/1188090 to your computer and use it in GitHub Desktop.
working yield return
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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