feat(behavior-tree): add pure BehaviorTreePlugin for Cocos/Laya integration (#400)
- Add BehaviorTreePlugin class that only depends on @esengine/ecs-framework - Implement IPlugin interface with install(), uninstall(), setupScene() methods - Remove esengine/ subdirectory that incorrectly depended on engine-core - Update package documentation with correct usage examples
This commit is contained in:
24
.changeset/add-behavior-tree-plugin.md
Normal file
24
.changeset/add-behavior-tree-plugin.md
Normal file
@@ -0,0 +1,24 @@
|
||||
---
|
||||
"@esengine/behavior-tree": minor
|
||||
---
|
||||
|
||||
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:
|
||||
```typescript
|
||||
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);
|
||||
```
|
||||
Reference in New Issue
Block a user