Liberi
An exergame built for kids with CP!
ParticleCleanup.cs
1 using UnityEngine;
2 using System.Collections;
3 
7 [Script(ScriptRole.View)]
8 public class ParticleCleanup : MonoBehaviour
9 {
10  void Awake ()
11  {
12  StartCoroutine(CheckParticleFinishedAsync());
13  }
14 
15  IEnumerator CheckParticleFinishedAsync ()
16  {
17  while (particleSystem.IsAlive())
18  yield return new WaitForSeconds(1f);
19 
20  Sync.Despawn(this);
21  }
22 }
static void Despawn(GameObject go)
Despawn the given object.
Definition: Sync.Static.cs:779
Despawns a particle system after it finishes playing.
This class server two main functions: 1) As a MonoBehaviour, it allows for network synchronization of...
Definition: Sync.cs:13