示例#1
0
        private void CallbackOnContextMenu(object obj)
        {
            switch (obj.ToString())
            {
            case "0":
                NodePopupWindow.InitPopupWindow();
                break;

            case "1":
                NodeUtils.LoadGraph();
                break;

            case "2":
                NodeUtils.UnloadGraph();
                break;

            case "3":
                NodeUtils.CreateNode(m_currGraph, NodeType.SELECTOR_NODE, m_mousePosition);
                break;

            case "4":
                NodeUtils.CreateNode(m_currGraph, NodeType.SEQUENCE_NODE, m_mousePosition);
                break;

            case "5":
                NodeUtils.CreateNode(m_currGraph, NodeType.INVERTER_NODE, m_mousePosition);
                break;

            case "6":
                NodeUtils.CreateNode(m_currGraph, NodeType.ACTION_NODE, m_mousePosition);
                break;

            default:
                break;
            }
        }
 public static void InitPopupWindow()
 {
     m_currPopup = GetWindow <NodePopupWindow>() as NodePopupWindow;
     m_currPopup.titleContent = new GUIContent("Create a new Graph");
     m_currPopup.minSize      = new Vector2(500, 500);
 }