- Home /
Question by
Scramasaxe · Aug 06, 2017 at 10:32 AM ·
guieditor-scriptingmouse button
Right click not working in the editor with sub windows.
The code below code mostly works. The problem I'm having is that when I right click one of these sub windows the event is lost or?
public void Update()
{
GUI.Window(m_Id, WinRect, DrawNodeWindow, WindowTitle);
}
void DrawNodeWindow(int id)
{
GUI.DragWindow();
}
I click the right outside one of these windows and I get my add state as expect, but if it's over one of these windows, it doesn't work.
The code below is the right mouse click code.
Event ev = Event.current;
if (ev.button == 1)
{
if (ev.type == EventType.MouseDown)
{
GenericMenu menu = new GenericMenu();
menu.AddItem(new GUIContent("Add State"), false, ContextCallback, "addState");
menu.ShowAsContext();
ev.Use();
}
}
Thanks for any help.
amecha.jpg
(6.1 kB)
Comment