From 445d19af7932d8d8090210571a46b2d2f1c0704a Mon Sep 17 00:00:00 2001 From: yangwen Date: Thu, 29 May 2025 17:48:51 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E6=BA=90=E9=A2=84=E5=8A=A0=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Main.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/Main.ts b/src/Main.ts index 07cb87f..a0d1960 100644 --- a/src/Main.ts +++ b/src/Main.ts @@ -1,4 +1,5 @@ import { config } from "./constants/config" +import { respath } from "./constants/respath" import { LevelManager } from "./models/LevelManager" import { StorageManager } from "./models/StorageManager" @@ -14,6 +15,24 @@ export class Main extends Laya.Script { config.DEBUG = this.debug LevelManager.getInstance().init() StorageManager.getInstance().init() + + const resources: Array<{ url: string, type?: any, lazy?: boolean }> = [ + { url: respath.home_top_dc_bg_normal, type: Laya.Loader.IMAGE }, + { url: respath.home_top_dc_bg_finish, type: Laya.Loader.IMAGE }, + { url: respath.dc_top_bg_normal, type: Laya.Loader.IMAGE }, + { url: respath.dc_top_bg_month_finish, type: Laya.Loader.IMAGE }, + { url: respath.trophy_bg_light_gold, type: Laya.Loader.IMAGE }, + { url: respath.trophy_bg_light_grey, type: Laya.Loader.IMAGE } + ] + Laya.loader.load(resources, + Laya.Handler.create(this, (success: Object) => { // 第二个参数:成功回调 + console.log("预加载资源结束>>>>", success) + }), + Laya.Handler.create(this, (resProg: number) => { // 第三个参数:进度回调 + console.log("预加载资源进度>>>>", resProg) + }) + ) + } onLateUpdate(): void {