select node

This commit is contained in:
zhandouxiaojiji committed 2020-10-19 17:50:37 +08:00
1 parent 46123a9b83
commit d2b0584c24
3 files changed
+34 -14

No files matched your search

+2 -3
View File
@@ -33,11 +33,10 @@ class BehaviorTree extends React.Component<BehaviorTreeProps> {
initGraph(graph: Graph) {
const { onSelectNode } = this.props;
graph.on('click', (ev: GraphEvent) => {
console.log("click", ev);
if (!ev.item) {
onSelectNode(null);
} else if (ev.item) {
onSelectNode(ev.item);
} else if (ev.item.getType() == "node") {
onSelectNode(ev.item as INode);
}
});