feat: 新增英雄出售功能并优化UI交互
- 在 Hero 类中添加 removeByEid 静态方法,用于安全移除英雄实体 - 在 HInfoComp 中集成出售按钮逻辑,点击可移除对应英雄并关闭信息面板 - 为 card.prefab 和 hnode.prefab 添加召唤/出售按钮及相关UI组件 - 调整 role_controller.prefab 面板高度并禁用部分组件 - 移除未使用的 hit-flash-white 场景资源文件 - 暂时注释 CardComp 中的触摸事件绑定以进行调试
This commit is contained in:
@@ -45,6 +45,17 @@ export class Hero extends ecs.Entity {
|
||||
super.destroy();
|
||||
}
|
||||
|
||||
static removeByEid(eid: number): boolean {
|
||||
const targetEid = Math.floor(eid);
|
||||
if (!targetEid) return false;
|
||||
const entity = ecs.getEntityByEid(targetEid);
|
||||
if (!entity) return false;
|
||||
const model = entity.get(HeroAttrsComp);
|
||||
if (!model || model.fac !== FacSet.HERO) return false;
|
||||
entity.destroy();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 加载并初始化英雄
|
||||
|
||||
Reference in New Issue
Block a user