mirror of
https://gitee.com/dgflash/oops-plugin-framework.git
synced 2026-05-07 01:01:09 +08:00
优化
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { BufferAsset, SpriteFrame, Texture2D } from "cc";
|
||||
import { oops } from "db://oops-framework/core/Oops";
|
||||
import { resLoader } from "./ResLoader";
|
||||
|
||||
/**
|
||||
* 加载Zip资源
|
||||
@@ -18,7 +18,7 @@ export class ZipLoader {
|
||||
*/
|
||||
static load(url: string): Promise<JSZip> {
|
||||
return new Promise((resolve, reject) => {
|
||||
oops.res.load(url, BufferAsset, async (error: Error | null, asset: BufferAsset) => {
|
||||
resLoader.load(url, BufferAsset, async (error: Error | null, asset: BufferAsset) => {
|
||||
if (error) return reject(error);
|
||||
|
||||
var zip = await JSZip.loadAsync(asset.buffer());
|
||||
@@ -76,11 +76,11 @@ export class ZipLoader {
|
||||
/** 释放Zip资源 */
|
||||
static release(url?: string) {
|
||||
if (url) {
|
||||
oops.res.release(url);
|
||||
resLoader.release(url);
|
||||
}
|
||||
else {
|
||||
this.zips.forEach((value: JSZip, key: string) => {
|
||||
oops.res.release(key);
|
||||
resLoader.release(key);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ const data: Map<string, any> = new Map();
|
||||
/** JSON数据表工具 */
|
||||
export class JsonUtil {
|
||||
/** 是否使用压缩包加载配置表 */
|
||||
static zip: boolean = false;
|
||||
static zip: boolean = true;
|
||||
|
||||
/**
|
||||
* 通知资源名从缓存中获取一个Json数据表
|
||||
|
||||
Reference in New Issue
Block a user