handle error if characterLayers are not set
This commit is contained in:
parent
bc219d0139
commit
85531745c9
@ -94,14 +94,18 @@ export class CustomizeScene extends AbstractCharacterScene {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public create(): void {
|
public create(): void {
|
||||||
const savedWokaLayers = gameManager.getCharacterLayers();
|
try {
|
||||||
if (savedWokaLayers && savedWokaLayers.length !== 0) {
|
const savedWokaLayers = gameManager.getCharacterLayers();
|
||||||
this.selectedLayers = [];
|
if (savedWokaLayers && savedWokaLayers.length !== 0) {
|
||||||
for (let i = 0; i < savedWokaLayers.length; i += 1) {
|
this.selectedLayers = [];
|
||||||
this.selectedLayers.push(
|
for (let i = 0; i < savedWokaLayers.length; i += 1) {
|
||||||
this.layers[i].findIndex((item) => item.id === gameManager.getCharacterLayers()[i])
|
this.selectedLayers.push(
|
||||||
);
|
this.layers[i].findIndex((item) => item.id === gameManager.getCharacterLayers()[i])
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.warn(error);
|
||||||
}
|
}
|
||||||
waScaleManager.zoomModifier = 1;
|
waScaleManager.zoomModifier = 1;
|
||||||
this.createSlotBackgroundTextures();
|
this.createSlotBackgroundTextures();
|
||||||
|
Loading…
Reference in New Issue
Block a user