Example #1
0
 private void SelectionChanged(BehaviourTreeBlueprint sender, EventArgs e)
 {
     if (sender.Selection.Count == 1)
         name = ObjectNames.NicifyVariableName(sender.Selection[0].GetType().Name);
     else
         name = "UBonsai Editor";
 }
Example #2
0
        public Node(Vector2 midPoint, BehaviourTreeBlueprint tree)
        {
            float width  = 32;
            float height = 32;

            Bounds = new Rect(midPoint.x - (width * 0.5f), midPoint.y - (height * 0.5f), width, height);
            _tree  = tree;
        }
Example #3
0
        public void OnEnable()
        {
            Debug.Log("TreeEditorWindow.OnEnable()");
            name = "UBonsai Editor";
            _commandHistory = new CommandHistory(false);
            _historyWindow = new CommandHistoryWindow(GenerateWindowID());
            _historyWindow.CommandHistory = _commandHistory;
            _currentTree = new BehaviourTreeBlueprint();
            _currentTree.CommandHistory = _commandHistory;

            _currentTree.SelectionChanged += SelectionChanged;
        }
Example #4
0
        public void OnDisable()
        {
            Debug.Log("TreeEditorWindow.OnDisable()");
            if (_currentTree != null)
            {
                _currentTree.SelectionChanged -= SelectionChanged;
                _currentTree.CommandHistory = null;
                _currentTree = null;
            }

            if (_historyWindow != null)
            {
                _historyWindow = null;
            }

            if (_commandHistory != null)
            {
                _commandHistory.Dispose();
                _commandHistory = null;
            }
        }
Example #5
0
 public ParallelNode(Vector2 midPoint, BehaviourTreeBlueprint tree)
     : base(midPoint, tree)
 {
 }
Example #6
0
 public SelectorNode(Vector2 midPoint, BehaviourTreeBlueprint tree)
     : base(midPoint, tree)
 {
 }
Example #7
0
 public ControlNode(Vector2 midPoint, BehaviourTreeBlueprint tree)
     : base(midPoint, tree)
 {
 }