Yes, im pretty sure… it is as follows:
void Awake()
{
system = GetComponent<ParticleSystem>();
systems = GetComponentsInChildren<ParticleSystem>();
}
void WhenIWantToStop()
{
for (byte i = 0; i < systems.Length; i++)
{
systems[i].enableEmission = false;
}
}
void WhenIWantToStop2()
{
system.Stop(true);
}
This is kind of pseudo code, but is exactly what happens in my class… I tried both forms, and the script is always attached to the parent Particle System… in this case to be honest it is only 1 particle system, and as I said, it really used to work, both ways… but this time, it is just hiding everything, I dont know why =/
@Fluzing : What you are suggesting is the inverse of what I want. I want that the existing particles remain existing for their lifetime values, and not to instantly disappear when I stop the emitter. My class is actually responsible for enabling and disabling the game object for performance purposes, but I checked and it is working correctly as well, it is not disabling the game object at the wrong time and is not what is causing the problem.
@hpjohn : Reason I dont want to do that is that if Im not mistaken, emissionRate only refers to the Emission/Time and Emission/Distance, but not the burst emissions. Also, I would have to save the number, so I can set it back up when I want to use that system again… and I want to use this class for the whole project, all kinds of particles, which is what I have been doing to be honest.
Something unexpected is happening now… I play the scene, have the particle system going, then through the inspector I disable the emitter component of shuriken. For exactly 7 frames (going through step by step) the particle system is still visible, and I can see it stopped emitting, while the remaining particles are still alive and behaving normally, but on the 8th frame, all particles abruptly disappear. THEN, the mysterious bit is that if I click on another window (for example on the browser, or Monodevelop… take the focus out of unity) when I click on unity again… the particles that were gone, appear again… but only for one frame… Idk but this is beginning to smell like a bug to me…