预加载特效序列帧
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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++
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user