I want to implement my own simplistic atlas editor in the inspector window. How do I get the relevant mouse move events?
There seems to be a property called EditorWindow.wantsMouseMove, but I don't know how to set this for my particular inspector view.
Answer by Bunny83
Apr 30, 2012 at 02:19 PM
You can't set wantsMouseMove in Editors since it's a property of EditorWindow. The whole editor is usually completly event driven. However mousemove events seems to not trigger the OnGUI / OnInspectorGUI callback, probably for performance reasons.
For what reason do you need mousemove events? Mousedrag-events are usually generated in all kind of windows. Also do you talk about mousemove events in the custom editor (inspector) itself, or in the scene view like the terrain editor?
The Terrain editor for example uses OnInspectorUpdate to repaint the whole inspector window when neccessary.
private void OnInspectorUpdate()
There are many ways to react to certain events.
I want to highlight the sprite within the atlas on mouseover, that is why I want to use the mousemove event. At the moment I do not know how implement highlighting either, but I'm working on it. I am using GUI.DrawTexture to display the atlas.
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
If you are a new user, check out our FAQ for more information.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
For troubleshooting common problems with Unity 5.x Editor (including Win 10).
To help users post good questions and use the site effectively we have posted a user guide. Please check it out.
Answers and Comments
4 People are following this question.
Script to create instance from in inspector
Unity3D 3.2, MonoDevelop debugger "inspector" problems
How can I add a new "Inspector" type?
Hide from inspector interface but not from the debug inspector?
Unexpected values at the inspector when initializing member values from built-in arrays