Add function to update sound interaction link target

This commit is contained in:
2026-04-02 19:41:43 +02:00
parent 7424cb7304
commit 2692e1aff7

View File

@@ -1971,6 +1971,36 @@ export function App({ store, initialStatusMessage }: AppProps) {
);
};
const updateSoundInteractionLinkTarget = (link: InteractionLink, targetSoundEmitterId: string) => {
if (link.action.type !== "playSound" && link.action.type !== "stopSound") {
return;
}
if (link.action.type === "playSound") {
commitInteractionLinkChange(
link,
createPlaySoundInteractionLink({
id: link.id,
sourceEntityId: link.sourceEntityId,
trigger: link.trigger,
targetSoundEmitterId
}),
"Updated play sound link target."
);
} else {
commitInteractionLinkChange(
link,
createStopSoundInteractionLink({
id: link.id,
sourceEntityId: link.sourceEntityId,
trigger: link.trigger,
targetSoundEmitterId
}),
"Updated stop sound link target."
);
}
};
const updateAnimationInteractionLinkTarget = (link: InteractionLink, targetModelInstanceId: string) => {
if (link.action.type !== "playAnimation" && link.action.type !== "stopAnimation") {
return;