StopEmittingAfterDelay

From Unify Community Wiki
Revision as of 02:14, 1 December 2005 by Outcast (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Author: Jon (Aarku)


Use this script on a particle emitter with Autodestruct on. After it stops emitting, the particles will fade naturally then the object will get destroyed.


using UnityEngine;
using System.Collections;

// Use this script on a particle emitter with Autodestruct on.
// After it stops emitting, the particles will fade naturally then
// the object will get destroyed.

public class StopEmittingAfterDelay : MonoBehaviour
{
	public float delay = 1F;
	
	void Start()
	{
		Invoke("StopEmitting", delay);
	}
	
	void StopEmitting()
 	{
		particleEmitter.emit = false;
	}
}
Personal tools
Namespaces

Variants
Actions
Navigation
Extras
Toolbox