|
|
|
@ -96,6 +96,7 @@ export class KJLImportConfigStore extends Singleton implements IConfigStore
|
|
|
|
|
UpdateOption(cof: IConfigOption<KJLImportConfigOption>)
|
|
|
|
|
{
|
|
|
|
|
this.UpdataVersion(cof);
|
|
|
|
|
this.materialList = [];
|
|
|
|
|
Object.assign(this.m_Option, cof.option);
|
|
|
|
|
if (this.uiOption)
|
|
|
|
|
this.uiOption = {
|
|
|
|
@ -159,16 +160,19 @@ export class KJLImportConfigStore extends Singleton implements IConfigStore
|
|
|
|
|
this.materialList.push({ keyIndex: i, kjlName: mtl.kjlName, materialName: "", url: "", isSelect: false, isRender: false });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
await this.AsyncLoadMaterials();
|
|
|
|
|
await this.AsyncLoadMaterials(0);
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
AsyncLoadMaterials = async () =>
|
|
|
|
|
AsyncLoadMaterials = async (startIndex: number) =>
|
|
|
|
|
{
|
|
|
|
|
this.queue.clear();
|
|
|
|
|
for (let i = 0, length = this.m_Option.materials.length; i < length; i++)
|
|
|
|
|
for (let i = startIndex; i < startIndex + 11; i++)
|
|
|
|
|
{
|
|
|
|
|
if (i >= this.m_Option.materials.length) continue;
|
|
|
|
|
let mtl = this.m_Option.materials[i];
|
|
|
|
|
if (!mtl || !mtl.id) continue;
|
|
|
|
|
let mtlInfo = this.materialList[i];
|
|
|
|
|
this.queue.add(async () =>
|
|
|
|
|
{
|
|
|
|
|
let promise: Promise<{ materialName: string, url: string; }>;
|
|
|
|
@ -183,7 +187,7 @@ export class KJLImportConfigStore extends Singleton implements IConfigStore
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let { materialName, url } = await promise;
|
|
|
|
|
this.materialList[i] = { keyIndex: i, kjlName: mtl.kjlName, materialName, url, isSelect: false, isRender: true };
|
|
|
|
|
Object.assign(mtlInfo, { keyIndex: i, kjlName: mtl.kjlName, materialName, url, isSelect: false, isRender: true });
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|