文档

Unity Engine

Unity Engine

PreUpdate

Player loop phase that prepares physics, input, navigation, and other systems before MonoBehaviour.Update runs.
阅读时间2 分钟最后更新于 5 天前

Definition

public struct PreUpdate

Remarks

PreUpdate
runs after
FixedUpdate
and before
Update
. Systems in this phase interpolate physics bodies, process input for IMGUI and the Input System package, send mouse events to scripts, update NavMesh agents, update wind, and update video playback.
This struct identifies a phase of the Player loop. It has no members. In the default Player loop, the
PlayerLoopSystem
for this phase contains a PlayerLoopSystem.subSystemList of native engine systems, each identified by one of the structs nested in this type.
Use 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.

Structs

Struct

Description

PreUpdate.AIUpdateNative Player loop system that updates NavMesh agents and applies NavMesh carving results before scripts update.
PreUpdate.CheckTexFieldInputNative Player loop system that records whether a text field has keyboard focus at the start of the frame.
PreUpdate.IMGUISendQueuedEventsNative Player loop system that sends queued input events to the immediate mode GUI (IMGUI) system.
PreUpdate.InputForUIUpdateNative Player loop system that reads input from the active input backend and dispatches it as input events to runtime UI Toolkit panels.
PreUpdate.NewInputUpdateNative Player loop system that processes input events for the Input System package when it's set to update dynamically each frame.
PreUpdate.Physics2DUpdateNative Player loop system that interpolates 2D physics body poses for the current frame.
PreUpdate.PhysicsCore2DUpdateNative Player loop system that performs the pre-update for the low-level 2D physics API in the Unity.U2D.Physics namespace.
PreUpdate.PhysicsUpdateNative Player loop system that interpolates 3D physics body positions for the current frame.
PreUpdate.SendMouseEventsNative Player loop system that sends mouse event messages, such as OnMouseDown and OnMouseEnter, to scripts.
PreUpdate.UIElementsPreparePanelRenderersA native engine system that the native player loop updates.
PreUpdate.UpdateVideoNative Player loop system that updates Video Player playback before scripts update.
PreUpdate.WindUpdateNative Player loop system that updates wind zones that affect SpeedTree vegetation.