fix(MissionCardComp): 优化任务卡片提示弹窗动画流程
重新实现提示弹窗的显示动画:添加初始缩放归零设置,调整为弹出回弹、停留再消失的完整动画逻辑
This commit is contained in:
@@ -391,8 +391,18 @@ export class MissionCardComp extends CCComp {
|
|||||||
if (tipNode) {
|
if (tipNode) {
|
||||||
tipNode.active = true;
|
tipNode.active = true;
|
||||||
Tween.stopAllByTarget(tipNode);
|
Tween.stopAllByTarget(tipNode);
|
||||||
|
|
||||||
|
// 设置初始状态:缩放为 0
|
||||||
|
tipNode.setScale(new Vec3(0, 0, 1));
|
||||||
|
|
||||||
tween(tipNode)
|
tween(tipNode)
|
||||||
.delay(2)
|
// 1. 弹出动画(微放大再回弹)
|
||||||
|
.to(0.15, { scale: new Vec3(1.1, 1.1, 1) }, { easing: 'quadOut' })
|
||||||
|
.to(0.05, { scale: new Vec3(1, 1, 1) })
|
||||||
|
// 2. 停留 1 秒
|
||||||
|
.delay(1)
|
||||||
|
// 3. 缩小消失动画
|
||||||
|
.to(0.15, { scale: new Vec3(0, 0, 1) }, { easing: 'quadIn' })
|
||||||
.call(() => {
|
.call(() => {
|
||||||
if (tipNode && tipNode.isValid) tipNode.active = false;
|
if (tipNode && tipNode.isValid) tipNode.active = false;
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user