添加根据数据创建行为树的方法

This commit is contained in:
gongxh
2025-09-16 18:12:33 +08:00
parent 1c5f9de608
commit d7fc1e49ae
7 changed files with 104 additions and 588 deletions

View File

@@ -51,7 +51,7 @@ export class WaitTime extends LeafNode {
private _value: number = 0;
constructor(duration: number = 0) {
super();
this._max = duration * 1000;
this._max = duration;
}
protected override open(): void {
@@ -61,7 +61,7 @@ export class WaitTime extends LeafNode {
public tick(): Status {
const currTime = new Date().getTime();
if (currTime - this._value >= this._max) {
if (currTime - this._value >= this._max * 1000) {
return Status.SUCCESS;
}
return Status.RUNNING;