diff --git a/docs/design/technical/仿真器实体与事件映射.md b/docs/design/technical/仿真器实体与事件映射.md new file mode 100644 index 0000000..2430727 --- /dev/null +++ b/docs/design/technical/仿真器实体与事件映射.md @@ -0,0 +1,67 @@ +# 仿真器实体与事件映射 + +## 实体总览 + +| 实体 | 类 | 生命周期 | 主要属性 | +|------|------|------|------| +| 无人机 | `DroneEntity` | 仿真全程 | Pos, Hp, Status, Route, ExposureTime | +| 发射平台 | `PlatformEntity` | 仿真全程 | Pos, PlatformType, AerosolType, MunitionCount, Cooldown | +| 飞行弹药 | `MunitionEntity` | 发射→到达释放高度 | Pos, LaunchMode, Target, HasArrived | +| 气溶胶云团 | `CloudEntity` | 弹药到达→消散 | Center, Radius, CoreDensity, IsDissipated | +| 管控区域 | `ControlZoneEntity` | 仿真全程 | Vertices, Min/MaxAltitude | + +## 事件一览 + +| 事件 | 触发条件 | 参数 | Unity 典型响应 | +|------|------|------|------| +| `OnMunitionLaunched` | 发射计划时间到达 + 平台就绪 | `MunitionEntity` | 生成炮弹模型,播放发射动画 | +| `OnCloudGenerated` | 弹药到达释放高度 | `CloudEntity` | 生成粒子系统,初始半径+颜色 | +| `OnDroneDestroyed` | 毁伤判定 HP ≤ 0 | `DroneEntity` | 播放爆炸/坠毁动画 | +| `OnDroneReachedTarget` | 到达最后航路点 | `DroneEntity` | 显示"目标抵达"提示 | +| `OnZoneIntruded` | 无人机进入管控区 | `DroneEntity`, `ControlZoneEntity` | 红色警报 | +| `OnSimulationEnded` | 所有无人机状态 ≠ Flying | 无 | 显示结果面板,触发报告生成 | + +## 实体 × 事件 矩阵 + +| | MunitionLaunched | CloudGenerated | DroneDestroyed | ReachedTarget | ZoneIntruded | SimEnded | +|------|:---:|:---:|:---:|:---:|:---:|:---:| +| DroneEntity | | | ✅ | ✅ | ✅ | | +| PlatformEntity | ✅ | | | | | | +| MunitionEntity | ✅ | | | | | | +| CloudEntity | | ✅ | | | | | +| ControlZoneEntity | | | | | ✅ | | +| 全局 | | | | | | ✅ | + +## 数据流 + +``` +FireSchedule (算法输出) + │ + ▼ +SimulationEngine.Tick() + │ + ├─ 时间到达 → PlatformEntity.Fire() → MunitionEntity 创建 + │ │ + │ ├─ OnMunitionLaunched ──→ Unity: 炮弹 3D 模型 + │ │ + │ └─ 飞行 → 到达释放高度 + │ │ + │ ├─ CloudEntity 创建 + │ │ + │ ├─ OnCloudGenerated ──→ Unity: 粒子系统 + │ │ + │ └─ 扩散 → 毁伤判定 + │ │ + │ ├─ DroneEntity.Hp -= dmg + │ │ + │ └─ HP≤0 → OnDroneDestroyed ──→ Unity: 爆炸动画 + │ + ├─ DroneEntity.Update() → 到达终点 + │ └─ OnDroneReachedTarget ──→ Unity: 抵达提示 + │ + ├─ ControlZone.ContainsPoint() + │ └─ OnZoneIntruded ──→ Unity: 红色警报 + │ + └─ All drones done + └─ OnSimulationEnded ──→ Unity: 结果面板 + 报告生成 +```