预加载特效序列帧

This commit is contained in:
2025-06-10 19:30:56 +08:00
parent 17c25ca099
commit 414f8e41b5
5 changed files with 676 additions and 599 deletions

View File

@@ -54,6 +54,10 @@ export class GameDone extends Laya.Script {
onAwake(): void {
ResourceManager.getInstance().loadTexture(respath.bg_done, this.bg)
ResourceManager.getInstance().loadTexture(respath.icon_star1, this.star1)
ResourceManager.getInstance().loadTexture(respath.icon_star1, this.star2)
ResourceManager.getInstance().loadTexture(respath.icon_star1, this.star3)
ResourceManager.getInstance().loadTexture(respath.icon_star2, this.star4)
this.owner.x = 0
this.owner.y = 0

View File

@@ -48,7 +48,13 @@ export class UISequenceAnimation extends Laya.Script {
}
const path = `${this.prefix + endStr}.png`
// ResourceManager.getInstance().loadTexture(path, this.image)
this.owner.skin = path
const obj = Laya.Loader.getRes(path)
if (obj) {
this.owner.texture = obj
} else {
this.owner.skin = path
}
this.currentIndex++
}