There is no straightforward way to preview all particle systems automatically in the same scene during edit mode because you risk lagging the editor severely when more particle systems are present. The only way to preview a group of particle systems without manually selecting multiple objects is to nest all particle system objects to a same parent object and this parent needs a particle system component as well, just uncheck all modules, emission and renderer especially, then when you select and simulate either particle system, the rest in the same object tree will simulate altogether.
Ok thanks for the info ifurkend. Too bad it canât be done. Maybe I can use shaders to move the shafts and other various elements rather than using the particle systems. But it might take more time than itâs worth.
Richard, are you sure this is supposed to work?
The particle system seem to advance 1 frame and then stop. We would need to call it every frame, but ExecuteInEditMode only call update when there is a scene change and in this case it gets called only once.
Anybody was able to make it work?
It would be very useful to preview particles all at once in the editor without selecting each.
Iâm pretty sure it works⌠I know other developers who are using the technique successfully. Admittedly, Iâm not sure about the update frequency of [ExecuteInEditMode] scripts though. Googling suggests youâre right about the update frequency, and some more googling suggests that this may work for you: https://answers.unity.com/questions/1006398/executeineditmode-than-runs-update-all-the-time.html
If/when you upgrade to 2017.3, youâll notice a new option in the Scene View Overlay, called Simulate Layers. You can use this to get the preview behavior you want, without writing any custom scripts.
Thank you very much! I am already on 2017.3 so Iâll use the latter.
I saw that option before but thought it was something for performance, some sort of particle culling.
Works beautifully now.
Hi Richard, going back to this as I am trying to control particles manually in gameplay.
Is there any way to set the time of the particle emittter?
The time property doesnât seem to work, it just continue to play.
And the simulate method seem to play all the particles up to the time given, there is no start time.
I am looking for something like Animator.StartPlayback.
You can seek in editor by moving the time slider, so I guess you have some way.
That will restart the system and play it up to the point you want.
If you want to be smarter for forwards scrubbing, you can detect that youâre going forwards, and avoid the restart, (set param 3 to false) and simply simulate forwards by newTime - ps.time.
Doesnât work. It seem to render few frames and rewind.
I found some code that set the randomseed property before simulating. If I do that, the parent emitter behave correctly, the child emitter still play when they shouldnât.
Is it a bug? Do I need to set the randomseed of all the child systems?
I made a bug report(1010191).
After further digging it seem to make it work you need to set the randomseed property of all the ParticleSystem involved, including children.
I donât think that is the expected behavior.
I think itâs probably âby designâ. I can see why itâs not ideal for you here though. The auto seed mode changes the seed on each restart. I suspect changing this behavior would cause problems for other users, so I think it must stay as it is.
As you have discovered, itâs simple to set a fixed seed to get the behavior you want (and you can always use a fresh seed in a situation where you do want it to trigger differently)
In the scene view, when playing a particle system in edit mode, there is a little dialog in the lower right corner with play/pause etc buttons in it. Itâs on there. We may have renamed it after feedback⌠just to keep you guessing!!
Iâve noticed this âSimulate Layersâ option, and itâs useful â but is there any way to set these layers through code?
For context: Our teamâs toolset sidesteps default GameObject selection, so when using the tool, our artists are never actually selecting the Particle System. Iâd like to set these Simulate Layers automatically when they open the tool.