Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
4.5 KiB
@esengine/behavior-tree
4.2.0
Minor Changes
-
#408
b9ea8d1Thanks @esengine! - feat: add action() and condition() methods to BehaviorTreeBuilderAdded new methods to support custom executor types directly in the builder:
action(implementationType, name?, config?)- Use custom action executors registered via@NodeExecutorMetadatacondition(implementationType, name?, config?)- Use custom condition executors
This provides a cleaner API for using custom node executors compared to the existing
executeAction()which only supports blackboard functions.Example:
// Define custom executor @NodeExecutorMetadata({ implementationType: 'AttackAction', nodeType: NodeType.Action, displayName: 'Attack', category: 'Combat' }) class AttackAction implements INodeExecutor { execute(context: NodeExecutionContext): TaskStatus { return TaskStatus.Success; } } // Use in builder const tree = BehaviorTreeBuilder.create('AI') .selector('Root') .action('AttackAction', 'Attack', { damage: 50 }) .end() .build();
4.1.2
Patch Changes
-
#406
0de4527Thanks @esengine! - fix(behavior-tree): export NodeExecutorMetadata as value instead of typeFixed the export of
NodeExecutorMetadatadecorator inexecution/index.ts. Previously it was exported asexport type { NodeExecutorMetadata }which only exported the type signature, not the actual function. This caused runtime errors in Cocos Creator: "TypeError: (intermediate value) is not a function".Changed to
export { NodeExecutorMetadata }to properly export the decorator function.
4.1.1
Patch Changes
- Updated dependencies [
3e5b778]:- @esengine/ecs-framework@2.7.1
4.1.0
Minor Changes
-
#400
d2af9caThanks @esengine! - feat(behavior-tree): add pure BehaviorTreePlugin class for Cocos/Laya integration- Added
BehaviorTreePluginclass that only depends on@esengine/ecs-framework - Implements
IPlugininterface withinstall(),uninstall(), andsetupScene()methods - Removed
esengine/subdirectory that incorrectly depended on@esengine/engine-core - Updated package documentation with correct usage examples
Usage:
import { Core, Scene } from '@esengine/ecs-framework'; import { BehaviorTreePlugin, BehaviorTreeBuilder, BehaviorTreeStarter } from '@esengine/behavior-tree'; Core.create(); const plugin = new BehaviorTreePlugin(); await Core.installPlugin(plugin); const scene = new Scene(); plugin.setupScene(scene); Core.setScene(scene); - Added
4.0.0
Patch Changes
- Updated dependencies [
1f3a76a]:- @esengine/ecs-framework@2.7.0
3.0.1
Patch Changes
- Updated dependencies [
04b08f3]:- @esengine/ecs-framework@2.6.1
3.0.0
Patch Changes
- Updated dependencies []:
- @esengine/ecs-framework@2.6.0
2.0.1
Patch Changes
- Updated dependencies [
a08a84b]:- @esengine/ecs-framework@2.5.1
2.0.0
Patch Changes
- Updated dependencies [
1f297ac]:- @esengine/ecs-framework@2.5.0
1.0.3
Patch Changes
- Updated dependencies [
7d74623]:- @esengine/ecs-framework@2.4.4
1.0.2
Patch Changes
- Updated dependencies [
ce2db4e]:- @esengine/ecs-framework@2.4.3