Neodroid  0.2.0
Machine Learning Environment Prototyping Tool
ParticleController.cs
Go to the documentation of this file.
1 //[ExecuteInEditMode]
2 
3 using UnityEngine;
4 
5 namespace droid.Runtime.Utilities.Misc.Extensions {
6  [RequireComponent(typeof(ParticleSystem))]
7  public class ParticleController : MonoBehaviour {
8  ParticleSystem _particle_system;
9 
10  // Use this for initialization
11  void Start() { this._particle_system = this.GetComponent<ParticleSystem>(); }
12 
13  // Update is called once per frame
14  void Update() {
15  if (Input.GetKey(KeyCode.Space)) {
16  if (this._particle_system.isPlaying) {
17  return;
18  }
19 
20  this._particle_system.Play(true);
21  } else {
22  //_particle_system.Pause (true);
23  this._particle_system.Stop(true);
24  }
25  }
26  }
27 }