ドキュメント

Unity Engine

Unity Engine

ParticleSystemSimulationSpace

Defines the coordinate space in which particles are simulated.
読み終わるまでの所要時間 1 分最終更新 1ヶ月前

Definition

  • Type: Enum
  • Namespace: UnityEngine
  • Assembly: UnityEngine.ParticleSystemModule
public enum ParticleSystemSimulationSpace

Remarks

The simulation space determines how particles' positions are calculated relative to their environment. This property controls whether particles are simulated in local space, world space, or relative to a custom transform. The space is defined by the
ParticleSystemSimulationSpace
enum.
For custom space simulation, use ParticleSystem.MainModule.customSimulationSpace to assign a specific Transform as the reference.
using UnityEngine;public class ParticleSimulationExample : MonoBehaviour{ [SerializeField] private ParticleSystem particleSystem; [SerializeField] private Transform customTransform; void Start() { var mainModule = particleSystem.main; // Set the simulation space to Custom and assign a transform. mainModule.simulationSpace = ParticleSystemSimulationSpace.Custom; mainModule.customSimulationSpace = customTransform; }}
Additional Resources: ParticleSystem.MainModule.

Fields

Value

Description

CustomSimulate particles relative to a custom transform component, defined by ParticleSystem.MainModule.customSimulationSpace.
LocalSimulate particles in local space.
WorldSimulate particles in world space.