StopEmittingAfterDelay

From Unify Community Wiki
Jump to: navigation, search

Author: Jonathan Czeck (aarku)

Description

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. FIXME

Usage

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. FIXME

C# - StopEmittingAfterDelay.cs

using UnityEngine;
 using System.Collections;
 
 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