protected bool ProcessEvents(Event currentEvent) { if (rect.Contains(currentEvent.mousePosition)) { // mousePosition = currentEvent.mousePosition - rect.position; EditorRendererEvent e = guiSystem.ProcessEvents(currentEvent, rect); if (e != null) { if (OnGUIEvent != null) { OnGUIEvent(e); } return(true); } if (renderUtil.camera.orthographic) { Vector2 invertedY = new Vector2(mousePosition.x, rect.height - mousePosition.y); mousePositionWorld = renderUtil.camera.ScreenToWorldPoint(invertedY * renderUtil.GetScaleFactor(rect.width, rect.height)); } switch (currentEvent.type) { case EventType.MouseDown: if (OnMouseDown != null) { OnMouseDown(); } break; case EventType.MouseUp: if (OnMouseUp != null) { OnMouseUp(); } break; } } else { mousePosition = new Vector2(-1, -1); mousePositionWorld = Vector2.zero; } return(false); }