Quantcast
Channel: Answers for "Drawing to scene view from EditorWindow?"
Viewing all articles
Browse latest Browse all 4

Answer by vjoseph

$
0
0
I know its fairly late to answer the question; but just for the records... **How to draw on scene from CustomEditor** The way I did it was to write a Custom Editor, and a custom Inspector for my component/object. My editor doesn't know about any inspector, and only exposes a bunch of delegates that it will call when it finds something interesting. It picks up values only from your object, and writes values to it. The custom inspector on the other hand will know about the existence of the custom editor, and will cache this editor in the OnEnable(). In this same function, the inspector will register to the delegates of the custom editor, and handle related sceneView changes when those delegates are called. [Remember to unregister from the delegates in OnDisable()] Whenever your inspector needs to update something in the editor, it updates the object and then triggers a repaint/refresh on the editor, which will force the editor to get fresh values and update accordingly. **Working with temporary objects created from script** [Editor and Temporary objects][1] [1]: http://answers.unity3d.com/questions/261808/unity-custom-editor-temporary-objects.html

Viewing all articles
Browse latest Browse all 4

Latest Images

Trending Articles



Latest Images