mirror of
https://github.com/gongxh0901/kunpocc-behaviortree.git
synced 2025-12-27 00:58:18 +00:00
添加根据数据创建行为树的方法
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user