Пример #1
0
    //draw the node window
    //change this to edit node instead
    void DrawNodeWindow(int id)
    {
        //edit the node
        if (GUILayout.Button("Edit Node"))
        {
            //windowsToAttach.Add(id);
            NodeSettings.OpenWindow(nodes[id]);
        }
        //attach to other nodes
        if (GUILayout.Button("Attach"))
        {
            windowsToAttach.Add(id);
        }

        GUI.DragWindow();
    }
Пример #2
0
    //handles all of the buttons
    void DrawButtons()
    {
        GUILayout.BeginArea(buttonSection);

        //add a new node and window to the main area
        if (GUILayout.Button("Add Node", GUILayout.Height(40)))
        {
            Node tmp = new Node("");
            tmp._ID        = nodes.Count;
            tmp._options   = new List <dialogueOption>();
            tmp._precalls  = new List <Call>();
            tmp._postcalls = new List <Call>();

            nodes.Add(tmp);
            //maybe remove?
            dialogue.addNode(tmp);
            windows.Add(new Rect(10, 10, 100, 100));
            //NodeSettings.OpenWindow();
            nodeConnections[tmp._ID] = new List <int>();
        }

        if (GUILayout.Button("Delete Node", GUILayout.Height(40)))
        {
            NodeSettings.OpenWindow();
        }

        if (GUILayout.Button("Load Tree", GUILayout.Height(40)))
        {
            TreeManager.OpenWindow(false, dialogue);
        }

        if (GUILayout.Button("Save Tree", GUILayout.Height(40)))
        {
            TreeManager.OpenWindow(true, dialogue);
        }

        if (GUILayout.Button("Close", GUILayout.Height(40)))
        {
            this.Close();
        }

        GUILayout.EndArea();
    }