diff --git a/common/BehaviorTreeModel.ts b/common/BehaviorTreeModel.ts index e8d2cd4..3a70195 100644 --- a/common/BehaviorTreeModel.ts +++ b/common/BehaviorTreeModel.ts @@ -39,6 +39,7 @@ export interface GraphNodeModel extends TreeGraphData { output?: string[]; children?: GraphNodeModel[]; conf: BehaviorNodeTypeModel; + debug?: boolean; size?: number[]; } diff --git a/common/Utils.ts b/common/Utils.ts index b27268f..97ce00c 100644 --- a/common/Utils.ts +++ b/common/Utils.ts @@ -71,6 +71,7 @@ export const createTreeData = (bNode: BehaviorNodeModel, settings: Settings) => args: bNode.args, input: bNode.input, output: bNode.output, + debug: bNode.debug, conf: settings.getNodeConf(bNode.name), }; treeData.size = calcTreeNodeSize(treeData); @@ -92,6 +93,7 @@ export const createFileData = (gNode: GraphNodeModel) => { args: gNode.args || undefined, input: gNode.input || undefined, output: gNode.output || undefined, + debug: gNode.debug, }; if (gNode.children) { nodeData.children = []; diff --git a/package.json b/package.json index c616514..2164a32 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "behavior3editor", - "version": "0.1.2", + "version": "0.1.3", "description": "行为树编辑器", "main": "./dist/main.js", "scripts": { diff --git a/render-process/Editor/index.tsx b/render-process/Editor/index.tsx index e98e945..e91a088 100644 --- a/render-process/Editor/index.tsx +++ b/render-process/Editor/index.tsx @@ -366,9 +366,9 @@ export default class Editor extends React.Component { if (!str || str == "") { return; } - this.onSelectNode(null); const data = Utils.createTreeData(JSON.parse(str), this.state.settings); this.autoId = Utils.refreshNodeId(data, this.autoId); + this.onSelectNode(null); if (!curNodeData.children) { curNodeData.children = []; } @@ -376,8 +376,8 @@ export default class Editor extends React.Component { // this.autoId = Utils.refreshNodeId(this.graph.findDataById("1") as GraphNodeModel); this.changeWithoutAnim(); } catch (error) { - message.error("粘贴数据有误"); - console.error("paste error", error); + // message.error("粘贴数据有误"); + console.log("paste error"); } }