mirror of
https://github.com/gongxh0901/kunpocc-behaviortree.git
synced 2025-12-27 00:58:18 +00:00
fix: 修复黑板数据清理不彻底bug
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
* 专门用于存储和管理行为树执行过程中的共享数据
|
||||
*/
|
||||
|
||||
import { IBTNode } from "../kunpocc-behaviortree";
|
||||
import { IBTNode } from "./BTNode/BTNode";
|
||||
|
||||
/**
|
||||
* 黑板数据接口
|
||||
@@ -81,9 +81,14 @@ export class Blackboard implements IBlackboard {
|
||||
public clean(): void {
|
||||
// 清空当前黑板数据
|
||||
this._data.clear();
|
||||
|
||||
|
||||
// 重置运行状态
|
||||
this.openNodes = new WeakMap<IBTNode, boolean>();
|
||||
|
||||
// 递归清理所有子黑板
|
||||
for (const child of this.children) {
|
||||
child.clean();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user