Files
esengine/packages/framework/behavior-tree/CHANGELOG.md
github-actions[bot] 87f71e2251 chore: release packages (#409)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-12-31 14:32:18 +08:00

4.5 KiB

@esengine/behavior-tree

4.2.0

Minor Changes

  • #408 b9ea8d1 Thanks @esengine! - feat: add action() and condition() methods to BehaviorTreeBuilder

    Added new methods to support custom executor types directly in the builder:

    • action(implementationType, name?, config?) - Use custom action executors registered via @NodeExecutorMetadata
    • condition(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 0de4527 Thanks @esengine! - fix(behavior-tree): export NodeExecutorMetadata as value instead of type

    Fixed the export of NodeExecutorMetadata decorator in execution/index.ts. Previously it was exported as export 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 d2af9ca Thanks @esengine! - feat(behavior-tree): add pure BehaviorTreePlugin class for Cocos/Laya integration

    • Added BehaviorTreePlugin class that only depends on @esengine/ecs-framework
    • Implements IPlugin interface with install(), uninstall(), and setupScene() 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);
    

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