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;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 加载并初始化英雄
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"ver": "1.2.0",
|
||||
"importer": "directory",
|
||||
"imported": true,
|
||||
"uuid": "e091410c-c7b6-4416-ae99-38697c103286",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"ver": "1.1.50",
|
||||
"importer": "scene",
|
||||
"imported": true,
|
||||
"uuid": "5e1d3eb2-c300-4627-94c7-2ee03b8314f1",
|
||||
"files": [
|
||||
".json"
|
||||
],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
Reference in New Issue
Block a user