Assets/_MolcaSDK/_VR/Scripts/Device Manager/Namespace:
MolcaSDK.VR.DeviceManagerType: RuntimeSubsystem on RuntimeManager
When to use
UseDeviceManager for kiosk / managed headset flows: check or activate a device against your backend, then FetchContent to deserialize ContentResponse into Scenario Data Config via SetFetchedContent. Pair with DeviceCheck as IPreloadCheck so loading waits until the device is valid.
OrganizationId is exposed for session logic; set explicitly with SetOrganizationId when your activation flow provides it (Scenario session reads org context when present).
Inspector setup
| Field | Purpose |
|---|---|
| Device check request | HttpRequestAsset — CheckDevice() |
| Device code request | HttpRequestAsset — ActivateDevice(code) sets JSON body { code } |
| Get content request | HttpRequestAsset — FetchContent() after success paths |
SendAsync() on the assets; configure base URL / headers per HttpClient / asset defaults.
Code
CheckDevice or successful ActivateDevice, the manager awaits FetchContent() internally (see source).
API (key members)
| Member | Description |
|---|---|
DeviceStatus | Static enum: NotActive / Active / Error |
OrganizationId | String; use SetOrganizationId |
CheckDevice() | Awaitable<bool> — sets status, calls FetchContent on success |
ActivateDevice(string code) | Posts code; on success, FetchContent |
FetchContent() | GET content; maps to ScenarioDataConfig |
SetOrganizationId(string orgId) | Manual org assignment |
Troubleshooting
- Always
Errorstatus — InspectHttpResponsefrom activation/check in debugger; verifyHttpRequestAssetendpoints and device API contract. - Home list still empty after success —
FetchContentmust succeed and return JSON that deserializes toContentResponse; confirmScenarioDataConfiginstance exists in scene/project. ScenarioSessionManager.OrgIdnull —OrganizationIdis only set if your flow callsSetOrganizationIdor you extendDeviceManagerto parse org from responses (current sample code leaves it to explicit setter).- Race with preload — Ensure DeviceCheck preload runs before UI that reads
ScenarioDataConfig.
Related
- Preload checks —
DeviceCheck/IPreloadCheck - Scenario Data Config —
SetFetchedContent - Session loading & events — org / content timing
- HttpRequestAsset — request assets
Unity Editor
DeviceManager component on prefab or bootstrap object; or Device Check UI in scene.
