Files
loneseDocument/Content/Blueprints/BP_InventoryDrop.md
meishibiezb a8bdf281ff update
2026-06-05 03:01:15 +08:00

57 lines
2.3 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# BP_InventoryDrop
## 基本信息
- **类型**: Blueprint (Actor)
- **父类**: Actor
- **源文件**: /Game/Blueprints/Playground/BP_InventoryDrop.BP_InventoryDrop
- **模块**: Content/Blueprints/Playground
## 功能概述
物品掉落物 Actor在场景中代表可拾取的物品实体。没有自定义变量通过 EventGraph5 事件, 8 节点)处理与 BP_InventoryComp 的交互逻辑。
## 设计用意
Playground 中用于测试物品掉落和拾取流程的 Actor验证 Inventory 系统在场景物体层面的交互能力。
## 职责范围
- 作为场景中的物品掉落实体存在
- 通过 BP_InventoryComp 与库存系统交互
## 项目内依赖
| 依赖项 | 关系 | 源文件 |
|--------|------|--------|
| BP_InventoryComp | 引用 | /Game/Blueprints/Playground/BP_InventoryComp |
## 外部视角
BP_InventoryDrop 是 Actor 的子类,从外部调用者视角:
**接口概览**
- 无自定义变量
**EventGraph 事件**
| 事件 | 类型 | 触发时机 | 行为 |
|------|------|----------|------|
| `事件开始运行` | 原生覆盖 (BeginPlay) | Actor 生成时 | 预留(当前无连线逻辑) |
| `事件Actor开始重叠` | 原生覆盖 (OnActorBeginOverlap) | 与其他 Actor 碰撞时 | 预留(当前无连线逻辑) |
| `事件Tick` | 原生覆盖 | 每帧 | 预留(当前无连线逻辑) |
| `On Component Begin Overlap (Box)` | 组件绑定事件 | 玩家进入掉落物触发区域时 | → 调用 ServerRPC |
| `ServerRPC` | 自定义事件 (RPC, Server) | 客户端触发拾取时 | 在服务器添加 BP_InventoryComp 组件 → 销毁自身 Actor |
**外部交互方式**
- 放置在 Playground 关卡中作为可拾取的物品掉落实体
- 通过 BP_InventoryComp 与库存系统交互(物品拾取)
- 无自定义公开函数,所有行为由事件驱动
## 使用方法
BP_InventoryDrop 在项目中的典型调用流程:
- **物品拾取流程** — 玩家进入掉落物触发区域 → On Component Begin Overlap 触发 → 调用 ServerRPCRPC 到服务器)→ 服务器端添加 BP_InventoryComp 组件并存入物品 → 销毁掉落物 Actor → 物品已转移到玩家库存
## 用例
| 引用方 | 路径 | 用途 |
|--------|------|------|
| Playground | `/Game/地图关卡/Playground` | 关卡中的物品掉落物,演示拾取交互 |