言語: 日本語
  • C#
  • JS
  • Boo

スクリプト言語

お好みのスクリプト言語を選択すると、サンプルコードがその言語で表示されます。

ParticleSystem.simulationSpace

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Sumbission failed

For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Switch to Manual
public var simulationSpace: ParticleSystemSimulationSpace;
public ParticleSystemSimulationSpace simulationSpace;
public simulationSpace as ParticleSystemSimulationSpace

Description

これによりパーティクルをシミュレーションする空間を選択します。ワールド座標またはローカル座標とすることが出来ます

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 ExampleClass : 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 ExampleClass(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')