Resources for understanding GuiUtility.hotcontrol.
Hi All.
Is there a good explanation out there of how GuiUtility.hotcontrol works in the Unity Editor (and specifically in custom editor scripts). I'm writing my own editor and I don't understand this area, so I want to read up on it, but I'm struggling to find much out there and the API documentation is pretty bare bones.
From what I've read, I have a vague notion that GuiUtility.hotcontrol is what the editor uses to identify the currently active editor control element (as in the button that your mouse is hovered over, or maybe a handle element within the scene view that has been selected?).
My custom editor has some handles in the scene view (OnSceneGui), and I'm trying to do something with the mouse drag event. However, the "Event.current" doesn't return as "mouseDrag" (despite the fact that this is what I'm doing in the scene view) unless I manually set GuiUtility.hotcontrol = 0 on the "mouseDown" event. Whilst it's good that I can get the mouse drag working in this way, I'd like to understand why this is the case.
Any help is appreciated.
Thanks, Matt
Answer by MattSawrey · Nov 04, 2019 at 04:42 PM
Giving this a bump in case the person with hot hot hotcontrol knowledge hasn't seen it.
Your answer
Follow this Question
Related Questions
How does GetTypeForControl work? Maybe bug? 1 Answer
GUIUtility.hotControl = 0 does not deselect scene object 1 Answer
Select GameObjects OnSceneView without Colliders 1 Answer
UnityEvent with all derived types in listeners serialized in Inspector 0 Answers
Information about when it is destroyed any GameObject on scene. 0 Answers