update: audio already use
This commit is contained in:
@@ -10,6 +10,8 @@ import { AudioManager } from "@/managers/AudioManager";
|
|||||||
import type { Vector3Tuple } from "@/types/three/three";
|
import type { Vector3Tuple } from "@/types/three/three";
|
||||||
import { logModelLoadError } from "@/utils/three/modelLoadLogger";
|
import { logModelLoadError } from "@/utils/three/modelLoadLogger";
|
||||||
|
|
||||||
|
const REPAIR_CASE_PAN_RANGE = 20;
|
||||||
|
|
||||||
interface RepairCaseErrorBoundaryProps {
|
interface RepairCaseErrorBoundaryProps {
|
||||||
children: ReactNode;
|
children: ReactNode;
|
||||||
}
|
}
|
||||||
@@ -63,6 +65,8 @@ export function RepairCaseObject({
|
|||||||
open,
|
open,
|
||||||
onInspect,
|
onInspect,
|
||||||
}: RepairCaseObjectProps): React.JSX.Element {
|
}: RepairCaseObjectProps): React.JSX.Element {
|
||||||
|
const pan = Math.max(-1, Math.min(1, position[0] / REPAIR_CASE_PAN_RANGE));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TriggerObject
|
<TriggerObject
|
||||||
position={position}
|
position={position}
|
||||||
@@ -72,6 +76,7 @@ export function RepairCaseObject({
|
|||||||
if (open) return;
|
if (open) return;
|
||||||
AudioManager.getInstance().playSound(REPAIR_CASE_OPEN_SOUND_PATH, 1, {
|
AudioManager.getInstance().playSound(REPAIR_CASE_OPEN_SOUND_PATH, 1, {
|
||||||
category: "sfx",
|
category: "sfx",
|
||||||
|
pan,
|
||||||
});
|
});
|
||||||
onInspect();
|
onInspect();
|
||||||
}}
|
}}
|
||||||
|
|||||||
Reference in New Issue
Block a user