修改主对象的名称

This commit is contained in:
AncTe committed 2023-09-06 11:59:44 +08:00
1 parent e6d96f6e2a
commit 7073ac92c6
35 files changed
+122 -134

No files matched your search

+5 -5
View File
@@ -19,9 +19,9 @@ export function readyAllResource() {
info.resource.forEach(v => {
const type = getTypeByResource(v);
if (type === 'zip') {
ancTe.zipResource.set(v, new Resource(v, 'zip'));
mota.zipResource.set(v, new Resource(v, 'zip'));
} else {
ancTe.resource.set(v, new Resource(v, type));
mota.resource.set(v, new Resource(v, type));
}
});
}
@@ -35,13 +35,13 @@ export function readyAllResource() {
loadData.forEach(v => {
const type = getTypeByResource(v);
if (type !== 'zip') {
ancTe.resource.set(v, new Resource(v, type));
mota.resource.set(v, new Resource(v, type));
}
});
ancTe.resource.forEach(v => v.active());
mota.resource.forEach(v => v.active());
loading.once('coreInit', () => {
const animates = new Resource('__all_animates__', 'text');
ancTe.resource.set('__all_animates__', animates);
mota.resource.set('__all_animates__', animates);
animates.active();
});
}
+3 -3
View File
@@ -52,7 +52,7 @@ export class Resource<
protected onLoadStart(v?: ResourceData[T]) {
if (this.format === 'bgm') {
// bgm 单独处理,因为它可以边播放边加载
ancTe.bgm.add(this.uri, v!);
mota.bgm.add(this.uri, v!);
}
}
@@ -61,7 +61,7 @@ export class Resource<
if (this.type === 'fonts') {
document.fonts.add(new FontFace(this.name, v as ArrayBuffer));
} else if (this.type === 'sounds') {
ancTe.sound.add(this.uri, v as ArrayBuffer);
mota.sound.add(this.uri, v as ArrayBuffer);
} else if (this.type === 'images') {
const name = `${this.name}${this.ext}` as ImageIds;
loading.on(
@@ -109,7 +109,7 @@ export class Resource<
const id = `${base}.${name}`;
const type = getTypeByResource(id) as NonZipResource;
const format = getZipFormatByType(type);
ancTe.resource.set(
mota.resource.set(
id,
new Resource(id, type).setData(file.async(format))
);