Game Development Reference
In-Depth Information
WaitForFixedUpdate
WaitForFixedUpdate waits until the next frame rate of the FixedUpdate() func-
tion. (For more details on FixedUpdate() , refer to Appendix A , Important Functions .)
WaitForFixedUpdate can only be used with a yield statement in coroutines .
An example of WaitForFixedUpdate is as follows:
// JavaScript user:
function Start() {
// Wait for FixedUpdate to finished
yield new WaitForFixedUpdate();
// Call After FixedUpdate
Debug.Log ("Call after FixedUpdate");
}
function FixedUpdate() {
Debug.Log ("FixedUpdate");
}
// C# user
IEnumerator Start() {
// Wait for FixedUpdate to finished
yield return new WaitForFixedUpdate();
// Call After FixedUpdate
Debug.Log ("Call after FixedUpdate");
}
function FixedUpdate() {
Debug.Log ("FixedUpdate");
}
Search WWH ::




Custom Search