StopEmittingAfterDelay

From Unify Community Wiki
(Difference between revisions)
Jump to: navigation, search
m (Text replace - "</csharp>" to "</syntaxhighlight>")
 
(4 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 +
[[Category: MonoBehaviour]]
 +
[[Category: ParticleEmitter]]
 +
[[Category: Particle Effects]]
 +
[[Category: C Sharp]]
 
Author: Jonathan Czeck (aarku)
 
Author: Jonathan Czeck (aarku)
 
==Description==
 
==Description==
Line 7: Line 11:
  
 
==C# - StopEmittingAfterDelay.cs==
 
==C# - StopEmittingAfterDelay.cs==
using UnityEngine;
+
<syntaxhighlight lang="csharp">
 +
using UnityEngine;
 
  using System.Collections;
 
  using System.Collections;
 
   
 
   
Line 24: Line 29:
 
  }
 
  }
 
  }
 
  }
 +
</syntaxhighlight>

Latest revision as of 20:47, 10 January 2012

Author: Jonathan Czeck (aarku)

[edit] 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

[edit] 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

[edit] 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