Skip to content

Commit

Permalink
Check spawn_and_move_media permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
johnshaughnessy committed Jun 23, 2023
1 parent 680d6db commit cd2a193
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions src/prefabs/prefabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,29 @@ type CameraPrefabT = () => EntityDef;
type CubeMediaPrefabT = () => EntityDef;
type MediaPrefabT = (params: MediaLoaderParams) => EntityDef;

type Permission =
| "spawn_camera"
| "spawn_and_move_media"
| "update_hub"
| "pin_objects"
| "spawn_emoji"
| "amplify_audio"
| "fly"
| "voice_chat"
| "spawn_drawing"
| "tweet"
| "kick_users"
| "mute_users";

export type PrefabDefinition = {
permission?: "spawn_camera";
permission?: Permission;
template: CameraPrefabT | CubeMediaPrefabT | MediaPrefabT;
};

export type PrefabName = "camera" | "cube" | "media" | "duck";

export const prefabs = new Map<PrefabName, PrefabDefinition>();
prefabs.set("camera", { permission: "spawn_camera", template: CameraPrefab });
prefabs.set("cube", { template: CubeMediaFramePrefab });
prefabs.set("media", { template: MediaPrefab });
prefabs.set("duck", { template: DuckPrefab });
prefabs.set("cube", { permission: "spawn_and_move_media", template: CubeMediaFramePrefab });
prefabs.set("media", { permission: "spawn_and_move_media", template: MediaPrefab });
prefabs.set("duck", { permission: "spawn_and_move_media", template: DuckPrefab });

0 comments on commit cd2a193

Please sign in to comment.