This commit is contained in:
meishibiezb
2026-06-05 03:01:15 +08:00
parent 29a3f77908
commit a8bdf281ff
41 changed files with 1935 additions and 779 deletions

View File

@@ -0,0 +1,58 @@
# BP_TestItem
## 基本信息
- **类型**: Blueprint (Actor)
- **父类**: Actor
- **源文件**: /Game/Blueprints/Playground/BP_TestItem.BP_TestItem
- **模块**: Content/Blueprints/Playground
## 功能概述
Playground 中的测试用物品 Actor用于验证物品系统的基础功能。通过 EventGraph4 事件, 23 节点)处理与 BP_InventoryComp 和 BP_DropItemInvComp 的交互逻辑。
## 设计用意
Playground 场景中的通用测试物品载体,用于验证物品的生成、持有、丢弃等基础流程。作为物品系统在场景中的最小可测试单元。
## 职责范围
- 作为场景中的测试物品 Actor 存在
- 通过 BP_InventoryComp 和 BP_DropItemInvComp 与库存系统交互
## 项目内依赖
| 依赖项 | 关系 | 源文件 |
|--------|------|--------|
| BP_InventoryComp | 引用 | /Game/Blueprints/Playground/BP_InventoryComp |
| BP_DropItemInvComp | 引用 | /Game/Blueprints/Playground/BP_DropItemInvComp |
## 外部视角
BP_TestItem 是 Actor 的子类,从外部调用者视角:
**接口概览**
- 无自定义变量
**EventGraph 事件**
| 事件 | 类型 | 触发时机 | 行为 |
|------|------|----------|------|
| `事件开始运行` | 原生覆盖 (BeginPlay) | Actor 生成时 | 预留(当前无连线逻辑) |
| `事件Actor开始重叠` | 原生覆盖 (OnActorBeginOverlap) | 与其他 Actor 碰撞时 | 预留(当前无连线逻辑) |
| `事件Tick` | 原生覆盖 | 每帧 | 预留(当前无连线逻辑) |
| `On Component Begin Overlap (Collison)` | 组件绑定事件 | 玩家进入物品触发区域时 | 检查 BP_DropItemInvComp 有效 → 获取 ItemCount → 获取 ItemViews → 打印物品名称和数量 → 延迟 → 通过 BP_DropItemInvComp.RequestMoveItem 转移物品 → 销毁自身 |
**外部交互方式**
- 放置在 Playground 关卡中作为测试物品实体
- 通过 BP_InventoryComp 和 BP_DropItemInvComp 与库存系统交互
- 由 BP_TestItemCluster 生成和管理
## 使用方法
BP_TestItem 在项目中的典型调用流程:
- **物品拾取流程** — 玩家进入测试物品触发区域 → On Component Begin Overlap → 验证 DropItemInvComp 有效 → 打印物品信息到屏幕 → RequestMoveItem 转移物品到玩家库存 → 延迟后销毁自身 Actor
- **批量生成流程** — BP_TestItemCluster 在场景中生成多个 BP_TestItem 子 Actor → 每个作为独立物品实例
## 用例
| 引用方 | 路径 | 用途 |
|--------|------|------|
| Playground | `/Game/地图关卡/Playground` | 关卡中的测试物品,验证物品系统基础流程 |
| BP_TestItemCluster | `/Game/Blueprints/Playground/BP_TestItemCluster` | 作为模板批量生成测试物品 |