Game Development Reference
In-Depth Information
WaitForFixedUpdate
WaitForFixedUpdate
waits until the next frame rate of the
FixedUpdate()
func-
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");
}