Пример #1
0
        public BonWindow()
        {
            titleContent = new GUIContent(Name);
            _launcher = new BonLauncher();
            _launcher.OnWindowOpen();

            _menuEntryToNodeType = CreateMenuEntries();
            Graph graph = _launcher.LoadGraph(BonConfig.DefaultGraphName);
            _currentCanvas = new BonCanvas(graph);
            _canvasList.Add(_currentCanvas);
            _menu = CreateGenericMenu();
        }
Пример #2
0
 private void CloseCanvas(BonCanvas canvas)
 {
     bool doSave = EditorUtility.DisplayDialog("Do you want to save.", "Do you want to save the graph " + canvas.FilePath + " ?",
         "Yes", "No");
     if (doSave)
     {
         if (canvas.FilePath == null) OpenSaveDialog();
         else _launcher.SaveGraph(canvas.Graph, canvas.FilePath);
     }
     _launcher.CloseGraph(canvas.Graph);
     _canvasList.Remove(canvas);
     if (_canvasList.Count > 0) _currentCanvas = _canvasList[0];
     else _currentCanvas = null;
 }
Пример #3
0
 private void SetCurrentCanvas(BonCanvas canvas)
 {
     _currentCanvas = canvas;
 }
Пример #4
0
 private void CreateCanvas(string path)
 {
     BonCanvas canvas;
     if (path != null) canvas = new BonCanvas(_launcher.LoadGraph(path));
     else canvas = new BonCanvas(_launcher.LoadGraph(BonConfig.DefaultGraphName));
     canvas.FilePath = path;
     _canvasList.Add(canvas);
     SetCurrentCanvas(canvas);
 }