文档

Unity Engine

Unity Engine

TimeUpdate

Player loop phase that waits for the previous frame to be presented and then updates the engine time for the new frame.
阅读时间2 分钟最后更新于 5 天前

Definition

public struct TimeUpdate

Remarks

TimeUpdate
runs first in each iteration of the Player loop, at the transition between two frames. Unity updates the time as early as possible so that all later variable-timestep systems in the frame use the same time values, such as Time.time and Time.deltaTime.
These values change while the
FixedUpdate
phase runs. For each fixed timestep, every system in that phase, including any custom systems you add to it, reads fixed-timestep values. During this time, Time.time returns Time.fixedTime and Time.deltaTime returns Time.fixedDeltaTime. This includes MonoBehaviour.FixedUpdate() and coroutines that yield WaitForFixedUpdate. When the
FixedUpdate
phase finishes, these properties return the values for the current frame again.
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

TimeUpdate.WaitForLastPresentationAndUpdateTimeNative Player loop system that waits for the previous frame to be presented and then updates the engine time for the new frame.