feat: 新增英雄召唤事件并优化UI布局与组件注释

- 在 MissionHeroComp 中召唤英雄后派发 MasterCalled 事件,以更新英雄信息面板
- 调整 hnode.prefab 中多个节点的位置和尺寸,优化界面布局
- 为多个 TypeScript 组件文件添加详细注释,说明职责、关键设计和依赖关系
- 在 MissionCardComp 中完善英雄信息面板的创建、排序和布局逻辑
This commit is contained in:
walkpan
2026-04-07 19:52:40 +08:00
parent e880613f8f
commit 81a07bc16c
12 changed files with 2952 additions and 2639 deletions

View File

@@ -1,3 +1,24 @@
/**
* @file MapModelComp.ts
* @description 地图数据模型组件ECS 纯数据层)
*
* 职责:
* 1. 存储地图相关的 **静态配置数据**(编号、资源路径等)。
* 2. 作为 GameMap 实体的数据层,由 ECS 自动注册和管理。
* 3. 不包含任何视图逻辑,纯粹作为数据容器供视图层读取。
*
* 关键属性:
* - id地图编号标识当前加载的关卡。
* - resPrefab地图显示预制体的资源路径由 GameMap.load() 异步加载。
*
* 注释掉的代码说明:
* - resConfigMap / resDeliveryMap计划中的地图配置和传送点数据路径已废弃
* - getResContentMiniMap / getResContentSlices / getResContentData
* 瓦片地图相关的资源路径生成方法(当前版本不使用瓦片地图)。
*
* 依赖:
* - ecsECS 框架)—— 通过 @ecs.register 注册为 ECS 组件
*/
/*
* @Author: dgflash
* @Date: 2022-08-04 15:08:34
@@ -7,35 +28,42 @@
import { ecs } from "../../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
/**
* MapModelComp —— 地图数据模型
*
* 存储地图编号和预制体路径等静态配置。
* 由 GameMap 实体在 init() 阶段自动挂载。
*/
@ecs.register('MapModel')
export class MapModelComp extends ecs.Comp {
/** 初始地图编号 */
/** 初始地图编号(当前固定为 1 */
id: number = 1;
// /** 地图数据配置 */
// /** 地图数据配置路径(已废弃) */
// resConfigMap: string = "config/map/map";
// /** 地图转场点数据配置 */
// /** 地图转场点数据配置路径(已废弃) */
// resDeliveryMap: string = "config/map/map_delivery";
/** 地图显示预制 */
/** 地图显示预制体资源路径(由 GameMap.load() 加载) */
resPrefab: string = "game/map/map_rpg";
/** 地图内容资源 */
// /** 获取小地图纹理资源路径(已废弃) */
// getResContentMiniMap(mapName: string): string {
// return `content/map/${mapName}/${mapName}/miniMap/texture`;
// };
// /** 地图瓦片资源 */
// /** 获取地图瓦片资源路径(已废弃) */
// getResContentSlices(bgName: string, key: string): string {
// return `content/map/${bgName}/${bgName}/slices/${key}/texture`;
// };
// /** 地图数据资源 */
// /** 获取地图数据资源路径(已废弃) */
// getResContentData(mapName: string): string {
// return `content/map/${mapName}/${mapName}`;
// };
/** ECS 组件移除时的释放钩子(当前无需清理) */
reset() {
}