private void SelectionChanged(BehaviourTreeBlueprint sender, EventArgs e) { if (sender.Selection.Count == 1) name = ObjectNames.NicifyVariableName(sender.Selection[0].GetType().Name); else name = "UBonsai Editor"; }
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; }
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; }
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; } }
public ParallelNode(Vector2 midPoint, BehaviourTreeBlueprint tree) : base(midPoint, tree) { }
public SelectorNode(Vector2 midPoint, BehaviourTreeBlueprint tree) : base(midPoint, tree) { }
public ControlNode(Vector2 midPoint, BehaviourTreeBlueprint tree) : base(midPoint, tree) { }