mirror of
https://gitee.com/dgflash/oops-plugin-framework.git
synced 2026-05-30 18:39:18 +08:00
框架内加载替换为oops.res.loadAsync
This commit is contained in:
@@ -18,7 +18,7 @@ export class ZipLoader {
|
||||
*/
|
||||
static load(url: string): Promise<JSZip> {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
let asset = await resLoader.load(url, BufferAsset);
|
||||
let asset = await resLoader.loadAsync(url, BufferAsset);
|
||||
var zip = await JSZip.loadAsync(asset.buffer());
|
||||
this.zips.set(url, zip);
|
||||
resolve(zip);
|
||||
|
||||
@@ -36,7 +36,7 @@ export class SpineFinishedRelease extends Component {
|
||||
}
|
||||
|
||||
private async loadSkeletonData() {
|
||||
let sd = await oops.res.load(this.resPath, sp.SkeletonData);
|
||||
let sd = await oops.res.loadAsync(this.resPath, sp.SkeletonData);
|
||||
if (sd) {
|
||||
this.spine.skeletonData = sd;
|
||||
this.spine.setAnimation(0, "animation", false);
|
||||
|
||||
@@ -73,7 +73,7 @@ export class LanguagePack {
|
||||
private loadJson(lang: string): Promise<void> {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
const path = `${LanguageData.path_json}/${lang}`;
|
||||
const jsonAsset = await resLoader.load(path, JsonAsset);
|
||||
const jsonAsset = await resLoader.loadAsync(path, JsonAsset);
|
||||
if (jsonAsset) {
|
||||
LanguageData.language.set(LanguageDataType.Json, jsonAsset.json);
|
||||
Logger.instance.logConfig(path, "下载语言包 json 资源");
|
||||
@@ -83,7 +83,7 @@ export class LanguagePack {
|
||||
return;
|
||||
}
|
||||
|
||||
const font = await resLoader.load(path, TTFFont);
|
||||
const font = await resLoader.loadAsync(path, TTFFont);
|
||||
if (font) {
|
||||
LanguageData.font = font;
|
||||
Logger.instance.logConfig(path, "下载语言包 ttf 资源");
|
||||
|
||||
Reference in New Issue
Block a user