Game Development Reference
In-Depth Information
Debug.Log ("WaitAndPrint = " + Time.time);
}
// C# user:
IEnumerator Start() {
// Starting = 0.0
Debug.Log ("Starting = " + Time.time);
yield return StartCoroutine(WaitAndPrint(5.0f));
// Done WaitAndPrint = 5.0
Debug.Log ("Done WaitAndPrint = " + Time.time);
}
IEnumerator WaitAndPrint(float waitTime) {
//Suspend execution for 5 seconds
yield return new WaitForSeconds(waitTime);
// WaitAndPrint = 5.0
Debug.Log ("WaitAndPrint = " + Time.time);
}
Search WWH ::




Custom Search