调整加分动画

This commit is contained in:
2025-06-04 20:15:38 +08:00
parent e5f952583d
commit 41f00e7e8a
4 changed files with 21 additions and 12 deletions

View File

@@ -11,26 +11,19 @@ export class ScoreAdd extends Laya.Script {
onAwake(): void {
this.label.scaleX = 0
this.label.skewY = 0
this.label.scaleY = 0
const d = this.owner.getComponent(AutoDestroy)
d.lifeTime = 2
}
onStart(): void {
let wait = 0
let duration = 300
Laya.Tween.to(this.label, { scaleX: 1, scaleY: 1 }, duration, Laya.Ease.strongIn, null, wait)
wait += duration
Laya.Tween.to(this.label, { scaleX: 1, scaleY: 1 }, 300, Laya.Ease.strongIn, null, 0)
duration = 300
Laya.Tween.to(this.label, { y: -102 }, duration, Laya.Ease.strongIn, null, wait)
wait += duration
Laya.Tween.to(this.label, { y: -102 }, 300, Laya.Ease.strongIn, null, 500)
duration = 300
Laya.Tween.to(this.label, { alpha: 0 }, duration, Laya.Ease.strongIn, null, wait)
wait += duration
Laya.Tween.to(this.label, { alpha: 0 }, 300, Laya.Ease.strongIn, null, 500)
}
public onSetText(text: string): void {