refactor(behavior-tree)!: 迁移到 Runtime 执行器架构 (#196)
* refactor(behavior-tree)!: 迁移到 Runtime 执行器架构 * fix(behavior-tree): 修复LogAction中的ReDoS安全漏洞 * feat(behavior-tree): 完善行为树核心功能并修复类型错误
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import { IService } from '@esengine/ecs-framework';
|
||||
import { BlackboardValueType } from '../Types/TaskStatus';
|
||||
import { BlackboardVariable } from '../Components/BlackboardComponent';
|
||||
import { BlackboardValueType, BlackboardVariable } from '../Types/TaskStatus';
|
||||
|
||||
/**
|
||||
* 全局黑板配置
|
||||
@@ -43,13 +42,18 @@ export class GlobalBlackboardService implements IService {
|
||||
description?: string;
|
||||
}
|
||||
): void {
|
||||
this.variables.set(name, {
|
||||
const variable: BlackboardVariable = {
|
||||
name,
|
||||
type,
|
||||
value: initialValue,
|
||||
readonly: options?.readonly ?? false,
|
||||
description: options?.description
|
||||
});
|
||||
readonly: options?.readonly ?? false
|
||||
};
|
||||
|
||||
if (options?.description !== undefined) {
|
||||
variable.description = options.description;
|
||||
}
|
||||
|
||||
this.variables.set(name, variable);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user