How can I make a script that will work in the Unity editor. It is necessary for:
There are 3 spheres attached to the mesh that define vertices of the mesh, how can I change the position of the spheres in the editor?
Tried: [ExecuteInEditMode] - it works the same as a regular script in playback.
Tell me, are there any other ways to call functions in the editor? (You need to move the spheres and create a mesh directly in the editor)
It is desirable that it was possible to track, the script works in the editor, or in playback (to turn off unnecessary searches of spheres by triangles)
|
2 answers
Perhaps the MenuItem will help you. It allows you to run the method in any convenient way from the editor, albeit with hot keys.
You can use the Application.isEditor property to check “not in the editor”. It just returns "and not in the editor you" :)
|
Those who stumble on this topic: Solved the question of the custom editor, it just turned out to be and was intended for this, I had to rewrite a couple of scripts, but then the convenience was further improved
|