调整加分动画

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

@@ -0,0 +1,13 @@
export class ResourceManager {
private static instance: ResourceManager
public static getInstance(): ResourceManager {
if (!ResourceManager.instance) {
ResourceManager.instance = new ResourceManager()
}
return ResourceManager.instance
}
}

View File

@@ -0,0 +1,3 @@
{
"uuid": "b3ea9175-3fb5-4ce2-b73d-bdf1f52d6754"
}

View File

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

View File

@@ -244,7 +244,7 @@ export class Stage extends Laya.Script {
this.score_current = score this.score_current = score
this.score_step = Math.ceil((this.score_current - this.score_last) / 24) this.score_step = Math.ceil((this.score_current - this.score_last) / 24)
if (this.score_current > this.score_last) if (this.score_current > this.score_last)
this.score_animation_wait_frame = 54 this.score_animation_wait_frame = 36
else else
this.score_animation_wait_frame = 0 this.score_animation_wait_frame = 0
this.data.set_score(score) this.data.set_score(score)