.
This commit is contained in:
@ -74,10 +74,9 @@ onMounted(() => {
|
||||
})
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
if (tileMap) {
|
||||
tileMap.destroyLayer('tiles')
|
||||
tileMap.removeAllLayers()
|
||||
tileMap.destroy()
|
||||
}
|
||||
if (!tileMap) return
|
||||
tileMap.destroyLayer('tiles')
|
||||
tileMap.removeAllLayers()
|
||||
tileMap.destroy()
|
||||
})
|
||||
</script>
|
||||
|
0
src/composables/characterComposable.ts
Normal file
0
src/composables/characterComposable.ts
Normal file
@ -11,7 +11,7 @@ export async function loadTexture(scene: Phaser.Scene, textureData: TextureData)
|
||||
|
||||
// Check if the texture is already loaded in Phaser
|
||||
if (gameStore.game.loadedTextures.find((texture) => texture === textureData.key)) {
|
||||
return Promise.resolve(true)
|
||||
return true
|
||||
}
|
||||
|
||||
// If there's already a loading promise for this texture, return it
|
||||
@ -49,7 +49,7 @@ export async function loadTexture(scene: Phaser.Scene, textureData: TextureData)
|
||||
}
|
||||
|
||||
textureLoadingPromises.delete(textureData.key) // Clean up the promise
|
||||
return Promise.resolve(false)
|
||||
return false
|
||||
})()
|
||||
|
||||
// Store the loading promise
|
||||
|
Reference in New Issue
Block a user