示例#1
0
        public void LoadBTree()
        {
            string text = EditorUtility.OpenFilePanel("Load Behavior Tree", BTEditorUtility.editorPath + "Config", "xml");

            if (!string.IsNullOrEmpty(text))
            {
                Debugger.Log("loadBTree");
                BTEditorConfig _config = BTEditorSerialization.ReadXMLAtPath(text);
                mGraphDesigner = (new BTGraphDesigner());
                mGraphDesigner.Load(_config);
            }
        }
        public static BTEditorConfig CreateBtreeEditorConfigFromGraphDesigner(BTGraphDesigner _graphDesigner)
        {
            BTEditorConfig _config = new BTEditorConfig();

            _config.mRootNode = CreateEditorTreeConfigFromRootEditorNode(_graphDesigner.mRootNode);
            _config.mRootNode.mIsEnterNode = true;

            _config.mDetachedNode = new List <BTEditorTreeConfig>();
            for (int i = 0; i < _graphDesigner.mDetachedNodes.Count; i++)
            {
                _config.mDetachedNode.Add(CreateEditorTreeConfigFromRootEditorNode(_graphDesigner.mDetachedNodes[i]));
            }
            return(_config);
        }
示例#3
0
 public void NewBTree()
 {
     Debugger.Log("createBTree");
     mGraphDesigner = null;
 }
        public static TreeConfig CreateTreeConfigFromBTreeGraphDesigner(BTGraphDesigner _graphDesigner)
        {
            BTNode _root = _graphDesigner.mRootNode.mEditorNode.mNode;

            return(BTFactory.CreateConfigFromBTreeRoot(_root));
        }