mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-22 03:07:04 +02:00
fix: don't update armor highlighting on protagonist shell switch
This commit is contained in:
1 parent
d81eddba44
commit
da767213cb
3 files changed
+353
-344
No files matched your search
+8
-12
@@ -80,16 +80,6 @@ export function ArmorHighlighting() {
|
||||
turretContainer.current?.position.copy(turretPosition);
|
||||
turretContainer.current?.rotation.copy(turretRotation);
|
||||
}
|
||||
|
||||
handleModelTransform(useTankopediaTemporary.getState().model.pose);
|
||||
modelTransformEvent.on(handleModelTransform);
|
||||
|
||||
return () => {
|
||||
modelTransformEvent.off(handleModelTransform);
|
||||
};
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
const unsubscribe = useTankopediaTemporary.subscribe(
|
||||
(state) => state.mode,
|
||||
(mode) => {
|
||||
@@ -97,8 +87,14 @@ export function ArmorHighlighting() {
|
||||
},
|
||||
);
|
||||
|
||||
return unsubscribe;
|
||||
});
|
||||
handleModelTransform(useTankopediaTemporary.getState().model.pose);
|
||||
modelTransformEvent.on(handleModelTransform);
|
||||
|
||||
return () => {
|
||||
modelTransformEvent.off(handleModelTransform);
|
||||
unsubscribe();
|
||||
};
|
||||
}, []);
|
||||
|
||||
const armorGltf = useArmor(protagonist.tank.id);
|
||||
const armorNodes = Object.values(armorGltf.nodes);
|
||||
|
||||
Reference in new issue
Block a user