I have drawn a texture in an EditorGUILayout hierarchy, using DrawPreviewTexture.
What is the simplest way to handle mouse clicks on that texture?
TIA!
I have drawn a texture in an EditorGUILayout hierarchy, using DrawPreviewTexture.
What is the simplest way to handle mouse clicks on that texture?
TIA!
[SOLVED]
The following code works…
void OnGUI()
{
Event e = Event.current;
int controlID = GUIUtility.GetControlID(FocusType.Passive);
switch (e.GetTypeForControl(controlID))
{
case EventType.MouseDown:
.
.
.