feat(界面): 为任务阶段切换添加缩放动画效果
在任务阶段切换时,为阶段节点添加缩放动画,提升视觉反馈和心流体验。动画在准备开始/结束和战斗开始/结束阶段触发,包含放大和回弹效果。
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
* - CardInitCoins —— 初始金币数
|
||||
* - UIID.Victory —— 结算弹窗
|
||||
*/
|
||||
import { _decorator, Vec3,Animation, instantiate, Prefab, Node, NodeEventType, ProgressBar, Label, CCInteger } from "cc";
|
||||
import { _decorator, Vec3,Animation, instantiate, Prefab, Node, NodeEventType, ProgressBar, Label, CCInteger, tween, v3, Tween } from "cc";
|
||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
||||
import { smc } from "../common/SingletonModuleComp";
|
||||
@@ -306,6 +306,19 @@ export class MissionComp extends CCComp {
|
||||
if (label) {
|
||||
label.string = MissionComp.PhaseNameMap[targetPhase] || "未知";
|
||||
}
|
||||
|
||||
// 阶段切换动感表现:针对阶段变化加入缩放与回弹动画,让流程充满心流体验
|
||||
if (targetPhase === MissionPhase.PrepareStart ||
|
||||
targetPhase === MissionPhase.PrepareEnd ||
|
||||
targetPhase === MissionPhase.BattleStart ||
|
||||
targetPhase === MissionPhase.BattleEnd) {
|
||||
Tween.stopAllByTarget(phaseNode);
|
||||
phaseNode.scale = v3(0.5, 0.5, 1);
|
||||
tween(phaseNode)
|
||||
.to(0.3, { scale: v3(1.5, 1.5, 1) }, { easing: "backOut" })
|
||||
.to(0.2, { scale: v3(1, 1, 1) }, { easing: "sineInOut" })
|
||||
.start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user