文档

Unity Engine

Unity Engine

FixedUpdate

Player loop phase that runs fixed-timestep updates, including MonoBehaviour.FixedUpdate and the physics simulation.
阅读时间2 分钟最后更新于 5 天前

Definition

public struct FixedUpdate

Remarks

Unity runs the
FixedUpdate
phase zero, one, or several times per frame, depending on how much time has passed and the value of Time.fixedDeltaTime. Systems in this phase call MonoBehaviour.FixedUpdate(), run the physics simulation, update fixed-rate animation and audio, and resume coroutines that yield WaitForFixedUpdate.
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

FixedUpdate.AudioFixedUpdateNative Player loop system that performs the audio system's fixed-timestep update.
FixedUpdate.ClearLinesNative Player loop system that clears debug lines drawn with Debug.DrawLine and Debug.DrawRay during the previous fixed update.
FixedUpdate.DirectorFixedSampleTimeNative Player loop system that samples the fixed-timestep time for PlayableDirector and PlayableGraph.
FixedUpdate.DirectorFixedUpdateNative Player loop system that processes PlayableGraph instances during the fixed update, before the physics simulation.
FixedUpdate.DirectorFixedUpdatePostPhysicsNative Player loop system that processes PlayableGraph instances after the physics simulation, such as to apply animation inverse kinematics (IK) and write bone transforms.
FixedUpdate.LegacyFixedAnimationUpdateNative Player loop system that updates legacy Animation components that animate physics.
FixedUpdate.NewInputFixedUpdateNative Player loop system that processes input events for the Input System package when it's set to update during the fixed update.
FixedUpdate.Physics2DFixedUpdateNative Player loop system that runs the 2D physics simulation step during the fixed update.
FixedUpdate.PhysicsCore2DFixedUpdateNative Player loop system that simulates the low-level 2D physics worlds in the Unity.U2D.Physics namespace that are set to simulate in the fixed update.
FixedUpdate.PhysicsFixedUpdateNative Player loop system that runs the 3D physics simulation step during the fixed update.
FixedUpdate.ScriptRunBehaviourFixedUpdateNative Player loop system that calls MonoBehaviour.FixedUpdate on all active scripts.
FixedUpdate.ScriptRunDelayedFixedFrameRateNative Player loop system that runs delayed script calls during the fixed update, such as coroutines that yield WaitForFixedUpdate.
FixedUpdate.XRFixedUpdateNative Player loop system that performs the fixed-timestep update for XR.