Add sound interaction actions and options
This commit is contained in:
@@ -26,7 +26,23 @@ export interface StopAnimationAction {
|
||||
targetModelInstanceId: string;
|
||||
}
|
||||
|
||||
export type InteractionAction = TeleportPlayerAction | ToggleVisibilityAction | PlayAnimationAction | StopAnimationAction;
|
||||
export interface PlaySoundAction {
|
||||
type: "playSound";
|
||||
targetSoundEmitterId: string;
|
||||
}
|
||||
|
||||
export interface StopSoundAction {
|
||||
type: "stopSound";
|
||||
targetSoundEmitterId: string;
|
||||
}
|
||||
|
||||
export type InteractionAction =
|
||||
| TeleportPlayerAction
|
||||
| ToggleVisibilityAction
|
||||
| PlayAnimationAction
|
||||
| StopAnimationAction
|
||||
| PlaySoundAction
|
||||
| StopSoundAction;
|
||||
|
||||
export interface InteractionLink {
|
||||
id: string;
|
||||
@@ -139,6 +155,20 @@ export interface CreateStopAnimationInteractionLinkOptions {
|
||||
targetModelInstanceId: string;
|
||||
}
|
||||
|
||||
export interface CreatePlaySoundInteractionLinkOptions {
|
||||
id?: string;
|
||||
sourceEntityId: string;
|
||||
trigger?: InteractionTriggerKind;
|
||||
targetSoundEmitterId: string;
|
||||
}
|
||||
|
||||
export interface CreateStopSoundInteractionLinkOptions {
|
||||
id?: string;
|
||||
sourceEntityId: string;
|
||||
trigger?: InteractionTriggerKind;
|
||||
targetSoundEmitterId: string;
|
||||
}
|
||||
|
||||
export function createPlayAnimationInteractionLink(options: CreatePlayAnimationInteractionLinkOptions): InteractionLink {
|
||||
assertNonEmptyString(options.sourceEntityId, "Interaction source entity id");
|
||||
assertNonEmptyString(options.targetModelInstanceId, "Play animation target model instance id");
|
||||
|
||||
Reference in New Issue
Block a user