feat: 新增英雄出售功能并优化UI交互

- 在 Hero 类中添加 removeByEid 静态方法,用于安全移除英雄实体
- 在 HInfoComp 中集成出售按钮逻辑,点击可移除对应英雄并关闭信息面板
- 为 card.prefab 和 hnode.prefab 添加召唤/出售按钮及相关UI组件
- 调整 role_controller.prefab 面板高度并禁用部分组件
- 移除未使用的 hit-flash-white 场景资源文件
- 暂时注释 CardComp 中的触摸事件绑定以进行调试
This commit is contained in:
walkpan
2026-03-28 12:04:41 +08:00
parent 47b8aeb789
commit a638f473a0
9 changed files with 753 additions and 1623 deletions

View File

@@ -277,22 +277,22 @@ export class CardComp extends CCComp {
/** 绑定触控:卡面点击使用,锁按钮点击切换锁定 */
private bindEvents() {
this.node.on(NodeEventType.TOUCH_START, this.onCardTouchStart, this);
this.node.on(NodeEventType.TOUCH_MOVE, this.onCardTouchMove, this);
this.node.on(NodeEventType.TOUCH_END, this.onCardTouchEnd, this);
this.node.on(NodeEventType.TOUCH_CANCEL, this.onCardTouchCancel, this);
this.Lock?.on(NodeEventType.TOUCH_END, this.onToggleLock, this);
this.unLock?.on(NodeEventType.TOUCH_END, this.onToggleLock, this);
// this.node.on(NodeEventType.TOUCH_START, this.onCardTouchStart, this);
// this.node.on(NodeEventType.TOUCH_MOVE, this.onCardTouchMove, this);
// this.node.on(NodeEventType.TOUCH_END, this.onCardTouchEnd, this);
// this.node.on(NodeEventType.TOUCH_CANCEL, this.onCardTouchCancel, this);
// this.Lock?.on(NodeEventType.TOUCH_END, this.onToggleLock, this);
// this.unLock?.on(NodeEventType.TOUCH_END, this.onToggleLock, this);
}
/** 解绑触控,防止节点销毁后残留回调 */
private unbindEvents() {
this.node.off(NodeEventType.TOUCH_START, this.onCardTouchStart, this);
this.node.off(NodeEventType.TOUCH_MOVE, this.onCardTouchMove, this);
this.node.off(NodeEventType.TOUCH_END, this.onCardTouchEnd, this);
this.node.off(NodeEventType.TOUCH_CANCEL, this.onCardTouchCancel, this);
this.Lock?.off(NodeEventType.TOUCH_END, this.onToggleLock, this);
this.unLock?.off(NodeEventType.TOUCH_END, this.onToggleLock, this);
// this.node.off(NodeEventType.TOUCH_START, this.onCardTouchStart, this);
// this.node.off(NodeEventType.TOUCH_MOVE, this.onCardTouchMove, this);
// this.node.off(NodeEventType.TOUCH_END, this.onCardTouchEnd, this);
// this.node.off(NodeEventType.TOUCH_CANCEL, this.onCardTouchCancel, this);
// this.Lock?.off(NodeEventType.TOUCH_END, this.onToggleLock, this);
// this.unLock?.off(NodeEventType.TOUCH_END, this.onToggleLock, this);
}
private onCardTouchStart(event: EventTouch) {