Question by
GrumpkinGames · Aug 08, 2016 at 09:45 PM ·
editorscriptingbasicsscene view
Scripts for executing one-off scene manipulation
Hey there, I'm still pretty new to Unity, and I wanted to ask about editor scripts:
Say I wanted to create some terrain, or a set of prefabs using a script, and I wanted to save that into the scene (instead of it just running when I hit play and undoing after returning to edit mode). Then I want to "disable" the script so it doesn't accidentally run in the editor again.
Do I just make a MonoBehavior script with the relevant code in Start() and decorate with [ExecuteInEditMode]? Save, get it to run, and then remove the attribute? This seems a little wonky.
Comment