FixedUpdate
Player loop phase that runs fixed-timestep updates, including MonoBehaviour.FixedUpdate and the physics simulation.
阅读时间2 分钟最后更新于 5 天前
Definition
- Type: Struct
- Namespace: UnityEngine.PlayerLoop
- Assembly: UnityEngine.CoreModule
public struct FixedUpdate
Remarks
Unity runs the 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.
FixedUpdateThis 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 |
|---|---|
| FixedUpdate.AudioFixedUpdate | Native Player loop system that performs the audio system's fixed-timestep update. |
| FixedUpdate.ClearLines | Native Player loop system that clears debug lines drawn with Debug.DrawLine and Debug.DrawRay during the previous fixed update. |
| FixedUpdate.DirectorFixedSampleTime | Native Player loop system that samples the fixed-timestep time for PlayableDirector and PlayableGraph. |
| FixedUpdate.DirectorFixedUpdate | Native Player loop system that processes PlayableGraph instances during the fixed update, before the physics simulation. |
| FixedUpdate.DirectorFixedUpdatePostPhysics | Native Player loop system that processes PlayableGraph instances after the physics simulation, such as to apply animation inverse kinematics (IK) and write bone transforms. |
| FixedUpdate.LegacyFixedAnimationUpdate | Native Player loop system that updates legacy Animation components that animate physics. |
| FixedUpdate.NewInputFixedUpdate | Native Player loop system that processes input events for the Input System package when it's set to update during the fixed update. |
| FixedUpdate.Physics2DFixedUpdate | Native Player loop system that runs the 2D physics simulation step during the fixed update. |
| FixedUpdate.PhysicsCore2DFixedUpdate | Native 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.PhysicsFixedUpdate | Native Player loop system that runs the 3D physics simulation step during the fixed update. |
| FixedUpdate.ScriptRunBehaviourFixedUpdate | Native Player loop system that calls MonoBehaviour.FixedUpdate on all active scripts. |
| FixedUpdate.ScriptRunDelayedFixedFrameRate | Native Player loop system that runs delayed script calls during the fixed update, such as coroutines that yield WaitForFixedUpdate. |
| FixedUpdate.XRFixedUpdate | Native Player loop system that performs the fixed-timestep update for XR. |