Exemple #1
0
        public void ExportBinaryBTree()
        {
            if (mGraphDesigner == null || mGraphDesigner.mRootNode == null)
            {
                EditorUtility.DisplayDialog("Export Error", "未创建根节点", "ok");
                return;
            }
            Debugger.Log("exportBtree");
            TreeConfig _treeConfig = BTEditorNodeFactory.CreateTreeConfigFromBTreeGraphDesigner(mGraphDesigner);
            string     name        = mGraphDesigner.mRootNode.NodeName;

            BTEditorSerialization.ExportBinary(_treeConfig, name);
            EditorUtility.DisplayDialog("Export", "导出行为树配置成功:" + name, "ok");
        }
Exemple #2
0
        public void ExportXMLBTree()
        {
            if (mGraphDesigner == null || mGraphDesigner.mRootNode == null)
            {
                EditorUtility.DisplayDialog("Export Error", "未创建根节点", "ok");
                return;
            }
            string text = EditorUtility.SaveFilePanel("Save Behavior Tree", BTEditorSerialization.exportConfigPath, mGraphDesigner.mRootNode.NodeName, "xml");

            if (text.Length != 0 && Application.dataPath.Length < text.Length)
            {
                Debugger.Log("exportBtree");
                TreeConfig _treeConfig = BTEditorNodeFactory.CreateTreeConfigFromBTreeGraphDesigner(mGraphDesigner);

                BTEditorSerialization.ExportXML(_treeConfig, System.IO.Path.GetFileNameWithoutExtension(text));
                EditorUtility.DisplayDialog("Export", "导出行为树配置成功:" + text, "ok");
            }
        }