Assets/_MolcaSDK/_VR/Scripts/Scenario/Session/ScenarioSessionManager.cs
When to use
UseScenarioSessionManager for backend-bound VR runs where you must create/auth a session, load scenario content, and report progress/score/status through server APIs.
Representative APIs
Confirm signatures in source; typical flows include:CreateSessionAsync(int orgScenarioId, string mode = "TRAINING")- Start / status / score methods bound to Scenario network config
LoadSessionWithModalAsync— modal + session create + start + scenario scene loadLoadSessionWithProgressAsync— same withOnLoadingProgress(0–1 + status string)
Load session with modal (conceptual)
Exact steps followScenarioSessionManager source; typical ordering:
Use LoadSessionWithProgressAsync when you supply your own progress UI instead of the default modal.
UnityEvents
OnTokenReceived, OnContentLoaded, OnScenarioStarted, OnScorePosted, OnSessionStatusChanged, OnError, OnScenarioSceneLoaded, OnScenarioSceneUnloaded, OnLoadingProgress.
Identifiers
OrgId may come from DeviceManager; PlayerId from SessionInfo.
Code
ScenarioSessionManager.cs for your SDK revision.
Troubleshooting
CreateSessionAsyncreturns false: verify auth/token stage, org scenario id, and network configuration assets.- Loading stalls before scene start: inspect
OnLoadingProgressandOnError; validate Addressables/scene keys used by scenario content. - Events not firing in listeners: subscribe after
RuntimeManager.WaitForInitialization()and unregister on disable.
Related
Unity Editor
RuntimeManager prefab → ScenarioSessionManager Inspector (network assets + read-only session fields in Play Mode).
