Makes onCameraUpdate subscribe-able
This commit is contained in:
parent
d9482d484b
commit
85d45071fa
@ -1,6 +1,6 @@
|
|||||||
import { IframeApiContribution, sendToWorkadventure } from "./IframeApiContribution";
|
import { IframeApiContribution, sendToWorkadventure } from "./IframeApiContribution";
|
||||||
import { Subject } from "rxjs";
|
import { Subject } from "rxjs";
|
||||||
import type { WasCameraUpdatedEvent, WasCameraUpdatedEventCallback } from "../Events/WasCameraUpdatedEvent";
|
import type { WasCameraUpdatedEvent } from "../Events/WasCameraUpdatedEvent";
|
||||||
import { apiCallback } from "./registeredCallbacks";
|
import { apiCallback } from "./registeredCallbacks";
|
||||||
import { isWasCameraUpdatedEvent } from "../Events/WasCameraUpdatedEvent";
|
import { isWasCameraUpdatedEvent } from "../Events/WasCameraUpdatedEvent";
|
||||||
|
|
||||||
@ -17,12 +17,12 @@ export class WorkAdventureCameraCommands extends IframeApiContribution<WorkAdven
|
|||||||
}),
|
}),
|
||||||
];
|
];
|
||||||
|
|
||||||
onCameraUpdate(callback: WasCameraUpdatedEventCallback): void {
|
onCameraUpdate(): Subject<WasCameraUpdatedEvent> {
|
||||||
moveStream.subscribe(callback);
|
|
||||||
sendToWorkadventure({
|
sendToWorkadventure({
|
||||||
type: "onCameraUpdate",
|
type: "onCameraUpdate",
|
||||||
data: null,
|
data: null,
|
||||||
});
|
});
|
||||||
|
return moveStream;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user