This selects the space in which to simulate particles. It can be either world or local space.
var useLocal : boolean = true; function Start () { useLocal = (particleSystem.simulationSpace == ParticleSystemSimulationSpace.Local); } function Update () { particleSystem.simulationSpace = (useLocal ? ParticleSystemSimulationSpace.Local : ParticleSystemSimulationSpace.World); } function OnGUI() { useLocal = GUI.Toggle(new Rect(10, 60, 200, 30), useLocal, " Use Local Simulation Space"); }
using UnityEngine; using System.Collections; public class Example : MonoBehaviour { public bool useLocal = true; void Start() { useLocal = particleSystem.simulationSpace == ParticleSystemSimulationSpace.Local; } void Update() { particleSystem.simulationSpace = ((useLocal) ? ParticleSystemSimulationSpace.Local : ParticleSystemSimulationSpace.World); } void OnGUI() { useLocal = GUI.Toggle(new Rect(10, 60, 200, 30), useLocal, " Use Local Simulation Space"); } }
import UnityEngine import System.Collections public class Example(MonoBehaviour): public useLocal as bool = true def Start() as void: useLocal = (particleSystem.simulationSpace == ParticleSystemSimulationSpace.Local) def Update() as void: particleSystem.simulationSpace = (ParticleSystemSimulationSpace.Local if useLocal else ParticleSystemSimulationSpace.World) def OnGUI() as void: useLocal = GUI.Toggle(Rect(10, 60, 200, 30), useLocal, ' Use Local Simulation Space')