public void LoadData(BTScript script) { if (_engine.IsDesignMode) return; UnloadData(); _script = script; _controller = new CTreeListController<Node>( behaviorTreeTL, _script.BehaviorTree, new BTTLNodeMapper()); _controller.AutoSortCompare = null; _controller.UpdateAllNodes(); if (behaviorTreeTL.Nodes.Count > 0) behaviorTreeTL.Nodes[0].ExpandAll(); behaviorTreeTL.FocusedNode = null; behaviorTreeTL.FocusedNode = behaviorTreeTL.Nodes.FirstNode; if (DataLoaded != null) DataLoaded(this, EventArgs.Empty); _engine.SceneLoaded += _engine_SceneLoaded; _nodeTypes = new List<Type>(GetNodeTypes()); }
private void UpdateCaption(BTScript data) { Text = "Behavior Tree Editor - [ " + data.Caption + " ]"; }
private void UnloadData() { _script = null; if (_controller != null) _controller.Dispose(); _engine.SceneLoaded -= _engine_SceneLoaded; }
public void LoadData(BTScript data) { scriptEditorControl.LoadData(data); }