fix: 禁用角色控制器并移除英雄数量动画

- 将角色控制器 prefab 的 _active 设为 false 以禁用该组件
- 注释掉英雄数量增加和拒绝时的动画播放逻辑,避免在英雄已满时触发无效动画
This commit is contained in:
panw
2026-04-08 09:09:05 +08:00
parent 72b31037f5
commit 32997f0a04
2 changed files with 17 additions and 17 deletions

View File

@@ -372,7 +372,7 @@ export class MissionCardComp extends CCComp {
payload.cancel = true;
payload.reason = "hero_limit";
oops.gui.toast(`英雄已满 (${current}/${heroMax})`);
this.playHeroNumDeniedAnim();
// this.playHeroNumDeniedAnim();
}
}
@@ -972,24 +972,24 @@ export class MissionCardComp extends CCComp {
private updateHeroNumUI(animate: boolean, isIncrease: boolean) {
this.syncMissionHeroData();
if (!animate || !isIncrease) return;
this.playHeroNumGainAnim();
// this.playHeroNumGainAnim();
}
private playHeroNumGainAnim() {
if (!this.hero_num_node || !this.hero_num_node.isValid) return;
const iconNode = this.hero_num_node.getChildByName("icon");
const numNode = this.hero_num_node.getChildByName("num");
this.playHeroNumNodePop(iconNode, 1.2);
this.playHeroNumNodePop(numNode, 1.2);
}
// private playHeroNumGainAnim() {
// if (!this.hero_num_node || !this.hero_num_node.isValid) return;
// const iconNode = this.hero_num_node.getChildByName("icon");
// const numNode = this.hero_num_node.getChildByName("num");
// this.playHeroNumNodePop(iconNode, 1.2);
// this.playHeroNumNodePop(numNode, 1.2);
// }
private playHeroNumDeniedAnim() {
if (!this.hero_num_node || !this.hero_num_node.isValid) return;
const iconNode = this.hero_num_node.getChildByName("icon");
const numNode = this.hero_num_node.getChildByName("num");
this.playHeroNumNodePop(iconNode, 1.2);
this.playHeroNumNodePop(numNode, 1.2);
}
// private playHeroNumDeniedAnim() {
// if (!this.hero_num_node || !this.hero_num_node.isValid) return;
// const iconNode = this.hero_num_node.getChildByName("icon");
// const numNode = this.hero_num_node.getChildByName("num");
// this.playHeroNumNodePop(iconNode, 1.2);
// this.playHeroNumNodePop(numNode, 1.2);
// }
private playHeroNumNodePop(node: Node | null, scalePeak: number) {
this.playNodeScalePop(node, scalePeak, 0.08, 0.1);