Add setVisibility method to RuntimeInteractionDispatcher and update handling in RuntimeInteractionSystem
This commit is contained in:
@@ -5,7 +5,9 @@ import {
|
|||||||
} from "../interactions/interaction-links";
|
} from "../interactions/interaction-links";
|
||||||
import {
|
import {
|
||||||
getInteractionLinkImpulseSteps,
|
getInteractionLinkImpulseSteps,
|
||||||
type ImpulseSequenceStep
|
type ImpulseSequenceStep,
|
||||||
|
type SequenceVisibilityMode,
|
||||||
|
type SequenceVisibilityTarget
|
||||||
} from "../sequencer/project-sequence-steps";
|
} from "../sequencer/project-sequence-steps";
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
@@ -35,6 +37,11 @@ export interface RuntimeInteractionDispatcher {
|
|||||||
visible: boolean | undefined,
|
visible: boolean | undefined,
|
||||||
link: InteractionLink
|
link: InteractionLink
|
||||||
): void;
|
): void;
|
||||||
|
setVisibility?(
|
||||||
|
target: SequenceVisibilityTarget,
|
||||||
|
mode: SequenceVisibilityMode,
|
||||||
|
link: InteractionLink
|
||||||
|
): void;
|
||||||
playAnimation(
|
playAnimation(
|
||||||
instanceId: string,
|
instanceId: string,
|
||||||
clipName: string,
|
clipName: string,
|
||||||
@@ -759,6 +766,25 @@ export class RuntimeInteractionSystem {
|
|||||||
link
|
link
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
|
case "setVisibility":
|
||||||
|
if (dispatcher.setVisibility !== undefined) {
|
||||||
|
dispatcher.setVisibility(step.target, step.mode, link);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (step.target.kind === "brush") {
|
||||||
|
dispatcher.toggleBrushVisibility(
|
||||||
|
step.target.brushId,
|
||||||
|
step.mode === "toggle" ? undefined : step.mode === "show",
|
||||||
|
link
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Error(
|
||||||
|
"Runtime visibility steps targeting model instances require dispatcher.setVisibility support."
|
||||||
|
);
|
||||||
|
return;
|
||||||
case "startDialogue":
|
case "startDialogue":
|
||||||
dispatcher.startDialogue(step.dialogueId, {
|
dispatcher.startDialogue(step.dialogueId, {
|
||||||
kind: "interactionLink",
|
kind: "interactionLink",
|
||||||
|
|||||||
Reference in New Issue
Block a user