refactor(map): 重构装备卡槽管理与节点挂载逻辑
1. 移除HeroBoxComp中未使用的ebars_node属性
2. 重构EBox.load方法,支持自定义父节点并更新注释
3. 重构MissEquipComp:
- 移除无用的BoxSet导入和硬编码槽位坐标
- 使用ebars_node子节点动态生成槽位
- 修改装备挂载逻辑,将装备挂载到对应ebar子节点而非直接设置位置
- 更新相关注释与日志提示
4. 调整mission.prefab的UI布局参数与绑定节点
This commit is contained in:
@@ -26,15 +26,17 @@ export class EBox extends ecs.Entity {
|
||||
|
||||
/**
|
||||
* 加载并初始化技能盒子
|
||||
* 1) 创建节点并挂到 SKILL 层
|
||||
* 1) 创建节点并挂到 parent 下(未传时默认 SKILL 层)
|
||||
* 2) 初始化表现与属性数据
|
||||
*/
|
||||
load(uuid: number, card_lv: number, pos: Vec3, prefab: Prefab): Node {
|
||||
load(uuid: number, card_lv: number, pos: Vec3, prefab: Prefab, parent?: Node): Node {
|
||||
let node = instantiate(prefab);
|
||||
let scene = smc.map.MapView.scene;
|
||||
|
||||
// 统一挂到实体显示层 SKILL 节点下
|
||||
let parent = scene.entityLayer!.node!.getChildByName("SKILL");
|
||||
// 默认挂到实体显示层 SKILL 节点下
|
||||
if (!parent) {
|
||||
let scene = smc.map.MapView.scene;
|
||||
parent = scene.entityLayer!.node!.getChildByName("SKILL") ?? undefined;
|
||||
}
|
||||
if (parent) {
|
||||
node.parent = parent;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user