fix: 禁用角色控制器并移除英雄数量动画
- 将角色控制器 prefab 的 _active 设为 false 以禁用该组件 - 注释掉英雄数量增加和拒绝时的动画播放逻辑,避免在英雄已满时触发无效动画
This commit is contained in:
@@ -1453,7 +1453,7 @@
|
|||||||
"__id__": 72
|
"__id__": 72
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_active": true,
|
"_active": false,
|
||||||
"_components": [
|
"_components": [
|
||||||
{
|
{
|
||||||
"__id__": 80
|
"__id__": 80
|
||||||
|
|||||||
@@ -372,7 +372,7 @@ export class MissionCardComp extends CCComp {
|
|||||||
payload.cancel = true;
|
payload.cancel = true;
|
||||||
payload.reason = "hero_limit";
|
payload.reason = "hero_limit";
|
||||||
oops.gui.toast(`英雄已满 (${current}/${heroMax})`);
|
oops.gui.toast(`英雄已满 (${current}/${heroMax})`);
|
||||||
this.playHeroNumDeniedAnim();
|
// this.playHeroNumDeniedAnim();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -972,24 +972,24 @@ export class MissionCardComp extends CCComp {
|
|||||||
private updateHeroNumUI(animate: boolean, isIncrease: boolean) {
|
private updateHeroNumUI(animate: boolean, isIncrease: boolean) {
|
||||||
this.syncMissionHeroData();
|
this.syncMissionHeroData();
|
||||||
if (!animate || !isIncrease) return;
|
if (!animate || !isIncrease) return;
|
||||||
this.playHeroNumGainAnim();
|
// this.playHeroNumGainAnim();
|
||||||
}
|
}
|
||||||
|
|
||||||
private playHeroNumGainAnim() {
|
// private playHeroNumGainAnim() {
|
||||||
if (!this.hero_num_node || !this.hero_num_node.isValid) return;
|
// if (!this.hero_num_node || !this.hero_num_node.isValid) return;
|
||||||
const iconNode = this.hero_num_node.getChildByName("icon");
|
// const iconNode = this.hero_num_node.getChildByName("icon");
|
||||||
const numNode = this.hero_num_node.getChildByName("num");
|
// const numNode = this.hero_num_node.getChildByName("num");
|
||||||
this.playHeroNumNodePop(iconNode, 1.2);
|
// this.playHeroNumNodePop(iconNode, 1.2);
|
||||||
this.playHeroNumNodePop(numNode, 1.2);
|
// this.playHeroNumNodePop(numNode, 1.2);
|
||||||
}
|
// }
|
||||||
|
|
||||||
private playHeroNumDeniedAnim() {
|
// private playHeroNumDeniedAnim() {
|
||||||
if (!this.hero_num_node || !this.hero_num_node.isValid) return;
|
// if (!this.hero_num_node || !this.hero_num_node.isValid) return;
|
||||||
const iconNode = this.hero_num_node.getChildByName("icon");
|
// const iconNode = this.hero_num_node.getChildByName("icon");
|
||||||
const numNode = this.hero_num_node.getChildByName("num");
|
// const numNode = this.hero_num_node.getChildByName("num");
|
||||||
this.playHeroNumNodePop(iconNode, 1.2);
|
// this.playHeroNumNodePop(iconNode, 1.2);
|
||||||
this.playHeroNumNodePop(numNode, 1.2);
|
// this.playHeroNumNodePop(numNode, 1.2);
|
||||||
}
|
// }
|
||||||
|
|
||||||
private playHeroNumNodePop(node: Node | null, scalePeak: number) {
|
private playHeroNumNodePop(node: Node | null, scalePeak: number) {
|
||||||
this.playNodeScalePop(node, scalePeak, 0.08, 0.1);
|
this.playNodeScalePop(node, scalePeak, 0.08, 0.1);
|
||||||
|
|||||||
Reference in New Issue
Block a user