@esengine/ai
Advanced tools
+2
-5
| { | ||
| "name": "@esengine/ai", | ||
| "version": "2.0.23", | ||
| "version": "2.0.24", | ||
| "description": "用于Laya、Cocos Creator等JavaScript游戏引擎的高性能AI系统库:行为树、实用AI和有限状态机", | ||
@@ -49,6 +49,3 @@ "main": "index.cjs", | ||
| }, | ||
| "sideEffects": false, | ||
| "dependencies": { | ||
| "@esengine/ecs-framework": "^2.1.20" | ||
| } | ||
| "sideEffects": false | ||
| } |
+1
-29
@@ -14,4 +14,4 @@ # BehaviourTree-AI | ||
| - 🔧 **可配置** - 灵活的配置选项,支持开发和生产环境 | ||
| - 🎯 **ECS集成** - 完整的ECS框架集成支持,提供组件、系统和预制模板 | ||
| ## 🚀 快速开始 | ||
@@ -70,32 +70,4 @@ | ||
| ### ECS框架集成 | ||
| 与[@esengine/ecs-framework](https://www.npmjs.com/package/@esengine/ecs-framework)完美集成: | ||
| ```typescript | ||
| import { Scene, Entity, Component } from '@esengine/ecs-framework'; | ||
| import { BehaviorTreeSystem, BehaviorTreeFactory } from '@esengine/ai/ecs-integration'; | ||
| // 创建场景和系统 | ||
| const scene = new Scene(); | ||
| const behaviorTreeSystem = new BehaviorTreeSystem(); | ||
| scene.addEntityProcessor(behaviorTreeSystem); | ||
| // 创建AI实体 | ||
| const entity = new Entity("AI", 1); | ||
| BehaviorTreeFactory.addBehaviorTreeToEntity( | ||
| entity, | ||
| (builder) => builder.action((entity) => { | ||
| console.log("AI正在思考..."); | ||
| return TaskStatus.Success; | ||
| }), | ||
| { debugMode: true } | ||
| ); | ||
| scene.addEntity(entity); | ||
| scene.update(); // 在游戏循环中调用 | ||
| ``` | ||
| 详细ECS集成文档请查看:[ecs-integration/README.md](./ecs-integration/README.md) | ||
| ## 📚 详细教程 | ||
@@ -102,0 +74,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
0
-100%1204573
-17.65%5195
-39.37%439
-6%- Removed
- Removed