Assets/_MolcaSDK/_VR/Scripts/Scenario/Session/ScenarioSessionManager.csNamespace:
MolcaSDK.VR.Scenario.SessionType: RuntimeSubsystem Handles visitor and member login, stores bearer token, raises
OnTokenReceived, loads content via GetContentAsync(), and drives session/scene flows (see full source for scene loading APIs).
Visitor
VisitorLoginAsync(string playerCode) — Requires exactly 6 characters; builds VisitorLoginRequest with otp field, POSTs through Scenario network config, then GetContentAsync() on success.
Member
MemberLoginAsync(string email, string password) — Preferred member flow; validates non-empty strings, POSTs MemberLoginRequest, then loads content.
Obsolete
MemberLoginAsyncUsingClerk(string clerkToken) — Marked obsolete; do not use for new work.
Success path
Stores bearer token, invokesOnTokenReceived, SetStatus(AUTHENTICATED), then GetContentAsync() which deserializes ContentResponse, applies ScenarioDataConfig.SetFetchedContent, and raises OnContentLoaded.
Network
Endpoints and baseHttpRequestAsset templates come from ScenarioNetworkConfig (e.g. YAML-backed); see Scenario network config.
Code
OnError, OnLoadingProgress, and OnContentLoaded in the Inspector for UI feedback without polling.
Troubleshooting
- Visitor login always fails — Input must be length 6; API errors surface on
OnError(inspectresponse.errorMessagein logs). GetContentAsyncreturns null / warning —IsAuthenticatedfalse (no token yet); ensure login completed successfully.- Member obsolete path — Replace
MemberLoginAsyncUsingClerkwithMemberLoginAsync(email, password). - Stuck in AUTHENTICATING — Network failure or exception; check
OnErrorand VPN/firewall to configured host. - Content empty — Response JSON missing
scenarioslist; verify backend contract vsContentResponsemodel.
Related
- Scenario network config
- Home UI — consumes FetchedScenarios
- Auth UI — shared widgets if used with VR
- HttpClient
- RuntimeManager
Unity Editor
Auth VR scene — Canvas with login fields, or AuthUI component Inspector.
