1
This commit is contained in:
@ -5,7 +5,8 @@ import {
|
||||
ModelLoadErrorPayload,
|
||||
ModelLoadProgressPayload,
|
||||
SceneReadyPayload,
|
||||
HotspotClickPayload
|
||||
HotspotClickPayload,
|
||||
DropZoneClickPayload
|
||||
} from './types';
|
||||
|
||||
/**
|
||||
@ -39,6 +40,10 @@ export class EventBridge {
|
||||
return emit("hotspot:click", payload);
|
||||
}
|
||||
|
||||
static dropZoneClick(payload: DropZoneClickPayload): Emitter {
|
||||
return emit("dropzone:click", payload);
|
||||
}
|
||||
|
||||
// Listeners
|
||||
static onModelLoadProgress(callback: (payload: ModelLoadProgressPayload) => void, context?: unknown): Emitter {
|
||||
return on("model:load:progress", callback, context);
|
||||
@ -65,6 +70,11 @@ export class EventBridge {
|
||||
static onHotspotClick(callback: (payload: HotspotClickPayload) => void, context?: unknown): Emitter {
|
||||
return on("hotspot:click", callback, context);
|
||||
}
|
||||
|
||||
static onDropZoneClick(callback: (payload: DropZoneClickPayload) => void, context?: unknown): Emitter {
|
||||
return on("dropzone:click", callback, context);
|
||||
}
|
||||
|
||||
static onceSceneReady(callback: (payload: SceneReadyPayload) => void, context?: unknown): Emitter {
|
||||
return once("scene:ready", callback, context);
|
||||
}
|
||||
|
||||
@ -46,3 +46,13 @@ export type HotspotClickPayload = {
|
||||
meshName?: string;
|
||||
payload?: unknown;
|
||||
};
|
||||
|
||||
export type DropZoneClickPayload = {
|
||||
wallName: string;
|
||||
index: number;
|
||||
center: any;
|
||||
width: number;
|
||||
height: number;
|
||||
normal: any;
|
||||
mesh: any;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user