Ejemplo n.º 1
0
    void OnGUI()
    {
        Rect actionWindowRect = new Rect(106f, 100f, 300, 340f);

        using (new Horizontal())
        {
            editorState.id = GUIUtility.GetControlID(this.GetHashCode(), FocusType.Passive);

            EditorUtil.painWindowRect        = new Rect(canvasWindowRect);
            EditorUtil.painWindowRect.width -= 200;
            editorState.canvasRect           = GUILayoutUtility.GetRect(canvasWindowRect.width - toobarWidth, canvasWindowRect.height);

            if (Event.current.type == EventType.Repaint)
            {
                editorState.Draw();
                // 用这个矩形覆盖掉toolbar下面的东西
                GUI.DrawTexture(ToolBarRect, EditorUtil.ToolBarBackground, ScaleMode.StretchToFill);
            }

            using (new Vertical())
            {
                Rect tool = GUILayoutUtility.GetRect(toobarWidth, 40);
                editorState.OnGUI();
            }
        }
        EditorInputSystem.HandleInputEvents(editorState);

        EditorInputSystem.HandleLateInputEvents(editorState);
    }
Ejemplo n.º 2
0
    private static void HandleContextClicks(EditorInputInfo inputInfo)
    {
        CombinMeshEditor cme = inputInfo.editorState.editor as CombinMeshEditor;

        if (cme.focusedNode == null)
        {
            return;
        }

        if (Event.current.button == 1 && cme.focusedNode.drawRect.Contains(inputInfo.inputPos))
        {
            GenericMenu contextMenu = new GenericMenu();
            if (cme.focusedNode != null)
            {
                EditorInputSystem.FillContextMenu(inputInfo, contextMenu);
            }
            contextMenu.ShowAsContext();
            Event.current.Use();
        }
    }
Ejemplo n.º 3
0
 private void OnFocus()
 {
     EditorInputSystem.SetupInput(editorState.eventTypeList);
 }