Change the rate over time multiplier.
This is more efficient than accessing the whole curve, if you only want to change the overall rate multiplier.
#pragma strict private var ps: ParticleSystem; public var hSliderValue: float = 5.0f; function Start() { ps = GetComponent.<ParticleSystem>(); } function Update() { var emission: var = ps.emission; emission.rateOverTimeMultiplier = hSliderValue; } function OnGUI() { hSliderValue = GUI.HorizontalSlider(new Rect(25, 45, 100, 30), hSliderValue, 5.0f, 200.0f); }
using UnityEngine; using System.Collections;
public class ExampleClass : MonoBehaviour { private ParticleSystem ps; public float hSliderValue = 5.0f;
void Start() { ps = GetComponent<ParticleSystem>(); }
void Update() { var emission = ps.emission; emission.rateOverTimeMultiplier = hSliderValue; }
void OnGUI() { hSliderValue = GUI.HorizontalSlider(new Rect(25, 45, 100, 30), hSliderValue, 5.0f, 200.0f); } }
Did you find this page useful? Please give it a rating: