Add sound emitter validation and interaction handling
This commit is contained in:
@@ -10,6 +10,8 @@ export interface RuntimeInteractionDispatcher {
|
||||
toggleBrushVisibility(brushId: string, visible: boolean | undefined, link: InteractionLink): void;
|
||||
playAnimation(instanceId: string, clipName: string, loop: boolean | undefined, link: InteractionLink): void;
|
||||
stopAnimation(instanceId: string, link: InteractionLink): void;
|
||||
playSound(soundEmitterId: string, link: InteractionLink): void;
|
||||
stopSound(soundEmitterId: string, link: InteractionLink): void;
|
||||
}
|
||||
|
||||
export interface RuntimeInteractionPrompt {
|
||||
@@ -220,6 +222,12 @@ export class RuntimeInteractionSystem {
|
||||
case "stopAnimation":
|
||||
dispatcher.stopAnimation(link.action.targetModelInstanceId, link);
|
||||
break;
|
||||
case "playSound":
|
||||
dispatcher.playSound(link.action.targetSoundEmitterId, link);
|
||||
break;
|
||||
case "stopSound":
|
||||
dispatcher.stopSound(link.action.targetSoundEmitterId, link);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,8 +49,10 @@ export interface RuntimePlayerStart {
|
||||
export interface RuntimeSoundEmitter {
|
||||
entityId: string;
|
||||
position: Vec3;
|
||||
radius: number;
|
||||
gain: number;
|
||||
audioAssetId: string | null;
|
||||
volume: number;
|
||||
refDistance: number;
|
||||
maxDistance: number;
|
||||
autoplay: boolean;
|
||||
loop: boolean;
|
||||
}
|
||||
@@ -340,8 +342,10 @@ function buildRuntimeSceneCollections(document: SceneDocument): RuntimeSceneColl
|
||||
runtimeEntities.soundEmitters.push({
|
||||
entityId: entity.id,
|
||||
position: cloneVec3(entity.position),
|
||||
radius: entity.radius,
|
||||
gain: entity.gain,
|
||||
audioAssetId: entity.audioAssetId,
|
||||
volume: entity.volume,
|
||||
refDistance: entity.refDistance,
|
||||
maxDistance: entity.maxDistance,
|
||||
autoplay: entity.autoplay,
|
||||
loop: entity.loop
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user