mirror of
https://github.com/storytold/storyteller-bevy.git
synced 2026-10-17 00:13:17 +00:00
343919a9f5
This PR Adds the ability to set the color of the skybox using the URL parameters. - Now you can pass a color's hexadecimal number (without the #) in the skybox parameter, and that will set the skybox to that color.
24 lines
901 B
TypeScript
24 lines
901 B
TypeScript
import { StudioMode } from "@storyteller/studio";
|
|
import { match } from "@storyteller/utility";
|
|
|
|
export class StudioURLParams {
|
|
#_nativeParams?: URLSearchParams;
|
|
get #nativeParams() {
|
|
return this.#_nativeParams ??= new URLSearchParams(document.location.search);
|
|
}
|
|
|
|
get objectId() { return this.#nativeParams.get("objectId") ?? undefined; }
|
|
get bvh() { return this.#nativeParams.get("bvh") ?? undefined; }
|
|
get mixamo() { return this.#nativeParams.get("mixamo") ?? undefined; }
|
|
get sceneImport() { return this.#nativeParams.get("sceneImport") ?? undefined; }
|
|
get scene() { return this.#nativeParams.get("scene") ?? undefined; }
|
|
get skybox() { return this.#nativeParams.get("skybox") ?? undefined; }
|
|
get mode(): StudioMode {
|
|
return match(this.#nativeParams.get("mode"), {
|
|
"studio": () => StudioMode.Editor,
|
|
"viewer": () => StudioMode.Viewer,
|
|
_: () => StudioMode.Viewer,
|
|
});
|
|
}
|
|
}
|