文档

Unity Engine

Unity Engine

SimulationMode

A selection of modes that control when Unity executes the physics simulation.
阅读时间1 分钟最后更新于 1 个月前

Definition

  • Type: Enum
  • Namespace: UnityEngine
  • Assembly: UnityEngine.PhysicsModule
public enum SimulationMode

Remarks

Additional Resources: Physics.simulationMode.

Examples

// SimulationMode.FixedUpdate is the default setting in Unity.// Attach this script to a gameObject and enter runtime mode.using UnityEngine;public class ManualPhysicsSimulation : MonoBehaviour{ void Start() { Debug.Log("Current Physics.simulationMode: " + Physics.simulationMode); }}

Fields

Value

Description

FixedUpdateUse this enumeration to instruct Unity to execute the physics simulation immediately after the MonoBehaviour.FixedUpdate().
ScriptUse this enumeration to instruct Unity to execute the physics simulation manually when you call Physics.Simulate.
UpdateUse this enumeration to instruct Unity to execute the physics simulation immediately after MonoBehaviour.Update().