workadventure/front/src/Phaser/Game/EmoteManager.ts
grégoire parant 4f0bb95a38
Emote silent zone (#1342)
* Add an emote when the user is in silent zone

* Update silent icon strategy

* Update strategy for silent zone

 - Add svelte store
 - Show silent zone indication and replace camera

This update permit to hide silent zone when user is in Jitsi discussion

* Fix css silent zone

Signed-off-by: Gregoire Parant <g.parant@thecodingmachine.com>
2021-09-05 18:36:22 +02:00

21 lines
587 B
TypeScript

import { emoteEventStream } from "../../Connexion/EmoteEventStream";
import type { GameScene } from "./GameScene";
import type { Subscription } from "rxjs";
export class EmoteManager {
private subscription: Subscription;
constructor(private scene: GameScene) {
this.subscription = emoteEventStream.stream.subscribe((event) => {
const actor = this.scene.MapPlayersByKey.get(event.userId);
if (actor) {
actor.playEmote(event.emote);
}
});
}
destroy() {
this.subscription.unsubscribe();
}
}