Update
Player loop phase that calls MonoBehaviour.Update, resumes coroutines, and runs other per-frame script updates.
Read time 2 minutesLast updated 5 days ago
Definition
- Type: Struct
- Namespace: UnityEngine.PlayerLoop
- Assembly: UnityEngine.CoreModule
public struct Update
Remarks
UpdatePreUpdatePreLateUpdate- Call MonoBehaviour.Update().
- Resume coroutines and Awaitable continuations that wait for the next frame or for a time delay.
- Run tasks posted to Unity's synchronization context, such as continuations of -based
Taskmethods.async - Process instances of PlayableGraph.
This struct identifies a phase of the Player loop. It has no members. In the default Player loop, the for this phase contains a PlayerLoopSystem.subSystemList of native engine systems, each identified by one of the structs nested in this type.
PlayerLoopSystemUse this type with PlayerLoopSystem.type to find the phase when you add your own systems to it, or when you reorder, replace, or remove the systems it contains. If you remove or replace a native system, Unity no longer performs that system's work, so the related engine feature might stop working. Some native systems are active only in the Editor, only in Players, or only on platforms and configurations that support the related feature. Elsewhere, those systems remain in the Player loop but don't do anything.
For more information, refer to Customizing the Player loop and Event function execution order.
Structs
Struct | Description |
|---|---|
| Update.DirectorUpdate | Native Player loop system that processes PlayableGraph instances during the Update stage, after MonoBehaviour.Update runs. |
| Update.ScriptRunBehaviourUpdate | Native Player loop system that calls MonoBehaviour.Update on all active scripts. |
| Update.ScriptRunDelayedDynamicFrameRate | Native Player loop system that runs delayed script calls that are due, such as coroutines that yield null or WaitForSeconds. |
| Update.ScriptRunDelayedTasks | Native Player loop system that runs tasks posted to Unity's synchronization context, such as continuations of Task-based async methods. |