Creates player state and uses it to get and set values from local storage
This commit is contained in:
parent
e025c1dc8e
commit
3490daed6b
9 changed files with 153 additions and 137 deletions
|
@ -3,7 +3,7 @@ import type { HasPlayerMovedEvent, HasPlayerMovedEventCallback } from "../Events
|
|||
import { Subject } from "rxjs";
|
||||
import { apiCallback } from "./registeredCallbacks";
|
||||
import { isHasPlayerMovedEvent } from "../Events/HasPlayerMovedEvent";
|
||||
import type { PlayerPropertyEvent } from "../Events/PlayerPropertyEvent";
|
||||
import { createState } from "./state";
|
||||
|
||||
const moveStream = new Subject<HasPlayerMovedEvent>();
|
||||
|
||||
|
@ -32,6 +32,8 @@ export const setUuid = (_uuid: string | undefined) => {
|
|||
};
|
||||
|
||||
export class WorkadventurePlayerCommands extends IframeApiContribution<WorkadventurePlayerCommands> {
|
||||
readonly state = createState("player");
|
||||
|
||||
callbacks = [
|
||||
apiCallback({
|
||||
type: "hasPlayerMoved",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue