/// <summary>
        /// A callback method to call the elements inside context menu
        /// </summary>
        /// <param name="obj"></param>
        void ContextCallback(object obj)
        {
            switch (obj.ToString())
            {
            case "0":
                //Debug.Log("Created a new graph");
                //ChainEditorUtilities.CreateNewGraph();
                GraphCreationPopUp.Open();
                break;

            case "1":
                //Debug.Log("Loaded a graph");
                ChainEditorUtilities.LoadGraph();
                break;

            case "2":
                //Debug.Log("Unloaded a graph");
                ChainEditorUtilities.UnloadGraph();
                break;

            case "3":
                ChainEditorUtilities.CreateNode(graph, NodeType.ChainBehaviorNode, _mousePos);
                break;

            case "4":
                ChainEditorUtilities.CreateNode(graph, NodeType.RootBehaviorNode, _mousePos);
                break;

            case "5":
                ChainEditorUtilities.DeleteNode(_deleteNodeIndex, graph);
                break;

            case "6":
                ChainEditorUtilities.UpdateGraphToModel(graph);
                break;
            }
        }
Example #2
0
 private void OnFile_CreateGrapph()
 {
     GraphCreationPopUp.Open();
 }
 /// <summary>
 /// Open a popup window
 /// </summary>
 public static void Open()
 {
     popup         = GetWindow <GraphCreationPopUp>(true, "Graph Creation Popup");
     popup.maxSize = popup.minSize = new Vector2(300, 130);
 }