import { AutoDestroy } from "./common/AutoDestroy" const { regClass, property } = Laya @regClass() export class ScoreAdd extends Laya.Script { declare owner: Laya.Box @property(Laya.Label) public label: Laya.Label onAwake(): void { this.label.scaleX = 0 this.label.skewY = 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 duration = 300 Laya.Tween.to(this.label, { y: -102 }, duration, Laya.Ease.strongIn, null, wait) wait += duration duration = 300 Laya.Tween.to(this.label, { alpha: 0 }, duration, Laya.Ease.strongIn, null, wait) wait += duration } public onSetText(text: string): void { this.label.text = text } }