- Home /
How is particle system execusint in edit mode?
If you add a particle system to the scene it starts emitting particles in edit mode and the animation is as smooth as in play mode.
I wonder if I can achieve this behavior in my scripts.
I know that the script will run in edit mode when you add [ExecuteInEditMode] before the class. But if it's a script that animates objects based on time (like a particle system), the scene view and the game view only refresh some times when you move the mouse. Which is not acceptable if you want to animate something.
I've also learned that if you add this to editor script, the views will keep repainting constantly:
public override bool RequiresConstantRepaint(){
return true;
}
But the frame rate is still not as smooth as in particle systems and in play mode. It's like it updates once per 0.1 seconds or so, which looks a bit jittery.
So I'm trying to find out how particle systems do this and if I can use the same method in my script to make it play smoothly in editor.
Your answer
Follow this Question
Related Questions
Custom Hashset inspector Issues 0 Answers
Check if 2 objects are selected in Scene View 2 Answers
SceneView.onSceneGUIDelegate GUI sorting problem 1 Answer