加分动画

This commit is contained in:
2025-05-27 14:59:33 +08:00
parent 0d47e04a6f
commit b6126cebad
11 changed files with 167 additions and 53 deletions

View File

@@ -8,7 +8,7 @@ export class AutoDestroy extends Laya.Script {
public lifeTime: number = 1;
//组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次
onAwake(): void {
onStart(): void {
if (this.lifeTime < 1) {
this.lifeTime = 1
}

View File

@@ -1,10 +1,10 @@
import { respath } from "../../constants/respath"
import { ScoreAdd } from "../ScoreAdd"
export function G_ShowScoreTips(text: string, parent: any): void {
Laya.loader.load(respath.score_add_ui_res).then((go)=>{
Laya.loader.load(respath.score_add_ui_res()).then((go)=>{
var prefab = go.create()
var obj = parent.addChild(prefab)
var Label = obj.getChildByName("offset").getChildByName("Label") as Laya.Label
Label.text = text
var score = parent.addChild(prefab).getComponent(ScoreAdd)
score.onSetText(text)
})
}