예제 #1
0
                private void SaveFilePanel()
                {
                    var path = EditorUtility.SaveFilePanel(
                        "Save Ai",
                        Application.dataPath + CATALOG,
                        "",
                        "AiBT");

                    behaviourPath = path;
                    TreeEditorIO.SaveTreeToFile(path, nodes);
                }
예제 #2
0
                private void HandlePanel()
                {
                    switch (selectedToolbar)
                    {
                    case -1:
                        return;

                    case 0:
                    {
                        if (EditorUtility.DisplayDialog("New Ai", "Are u sure about this?", "Plus", "Minus"))
                        {
                            NewBehaviour();
                            Repaint();
                        }
                    }
                    break;

                    case 1:
                    {
                        var path = EditorUtility.OpenFilePanel(
                            "Open Ai file",
                            Application.dataPath + CATALOG,
                            "AiBT");

                        LoadAiFromFile(path);
                    }
                    break;

                    case 2:
                    {
                        SaveFilePanel();
                    }
                    break;

                    case 3:
                    {
                        ;
                        if (behaviourPath != string.Empty)
                        {
                            TreeEditorIO.SaveTreeToFile(behaviourPath, nodes);
                        }
                        else
                        {
                            SaveFilePanel();
                        }
                    }
                    break;
                    }
                    selectedToolbar = -1;
                }