- Home /
Question by
MoritzWill · Oct 21, 2016 at 07:13 PM ·
c#playmodesave scene
How to run a script outside Playmode?
I programmed a script(c#), which creates a scene in Playmode that i want to save, with the result that the created scene won't be deleted after quitting Playmode . I realized , that this is not possible without spending money. Now I'd like to run the script, which creates the level, outside Playmode, so that i can save the Scene. But i don't know if this is even possible. Is there a way to do that? Thanks in advance! ;)
Comment
Answer by hexagonius · Oct 21, 2016 at 07:33 PM
For running scripts outside of play mode use the [ExecuteInEditMode] Attribute:
https://docs.unity3d.com/ScriptReference/ExecuteInEditMode.html