Curve to control which frame of the texture sheet animation to play.
See Also: MinMaxCurve.
#pragma strict private var ps: ParticleSystem; function Start() { ps = GetComponent.<ParticleSystem>(); var main: var = ps.main; main.startLifetimeMultiplier = 2.0f; var tex: var = ps.textureSheetAnimation; tex.enabled = true; tex.numTilesX = 4; tex.numTilesY = 2; // A simple ping-pong curve. var curve: AnimationCurve = new AnimationCurve(); curve.AddKey(0.0f, 0.0f); curve.AddKey(0.5f, 1.0f); curve.AddKey(1.0f, 0.0f); // Apply the curve. tex.frameOverTime = new ParticleSystem.MinMaxCurve(1.0f, curve); }
using UnityEngine;
public class ExampleClass : MonoBehaviour { private ParticleSystem ps;
void Start() { ps = GetComponent<ParticleSystem>();
var main = ps.main; main.startLifetimeMultiplier = 2.0f;
var tex = ps.textureSheetAnimation; tex.enabled = true; tex.numTilesX = 4; tex.numTilesY = 2;
// A simple ping-pong curve. AnimationCurve curve = new AnimationCurve(); curve.AddKey(0.0f, 0.0f); curve.AddKey(0.5f, 1.0f); curve.AddKey(1.0f, 0.0f);
// Apply the curve. tex.frameOverTime = new ParticleSystem.MinMaxCurve(1.0f, curve); } }
Did you find this page useful? Please give it a rating: