diff --git a/app/react/components/pixi/entity.js b/app/react/components/pixi/entity.js index 7925b70..7d520c0 100644 --- a/app/react/components/pixi/entity.js +++ b/app/react/components/pixi/entity.js @@ -54,6 +54,8 @@ export default class Entity { this.debug.removeChild(this.interactionAabb); } this.interactionAabb = undefined; + this.diffuse.rotation = 0; + this.normals.rotation = 0; } setDebug(isDebugging) { if (isDebugging) { @@ -141,7 +143,9 @@ export default class Entity { this.entity.Sprite.animation, this.entity.Sprite.frame, ); - diffuse.texture = texture; + if (diffuse.texture !== texture) { + diffuse.texture = texture; + } if (asset.data.meta.normals) { const {pathname} = new URL( Sprite.source @@ -157,17 +161,14 @@ export default class Entity { this.entity.Sprite.animation, this.entity.Sprite.frame, ); - normals.texture = texture; + if (normals.texture !== texture) { + normals.texture = texture; + } }); } }); } } - if (!this.attached) { - const {diffuse, normals} = this; - diffuse.rotation = 0; - normals.rotation = 0; - } if (Direction) { const {diffuse, normals} = this; if (!this.attached || 'direction' in Direction) {