Skip to main content
Folder: Assets/_MolcaSDK/_VR/Scripts/Device Manager/
Namespace: MolcaSDK.VR.DeviceManager
Type: RuntimeSubsystem on RuntimeManager

When to use

Use DeviceManager 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

FieldPurpose
Device check requestHttpRequestAssetCheckDevice()
Device code requestHttpRequestAssetActivateDevice(code) sets JSON body { code }
Get content requestHttpRequestAssetFetchContent() after success paths
All calls use SendAsync() on the assets; configure base URL / headers per HttpClient / asset defaults.

Code

using Molca;
using MolcaSDK.VR.DeviceManager;

public static async Awaitable<bool> RunDeviceGate()
{
    var dm = RuntimeManager.GetSubsystem<DeviceManager>();
    if (dm == null)
        return false;

    bool ok = await dm.CheckDevice();
    if (!ok)
    {
        var act = await dm.ActivateDevice("USER-ENTRY-CODE");
        ok = act.isSuccess;
    }
    return ok;
}
After CheckDevice or successful ActivateDevice, the manager awaits FetchContent() internally (see source).

API (key members)

MemberDescription
DeviceStatusStatic enum: NotActive / Active / Error
OrganizationIdString; 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 Error status — Inspect HttpResponse from activation/check in debugger; verify HttpRequestAsset endpoints and device API contract.
  • Home list still empty after successFetchContent must succeed and return JSON that deserializes to ContentResponse; confirm ScenarioDataConfig instance exists in scene/project.
  • ScenarioSessionManager.OrgId nullOrganizationId is only set if your flow calls SetOrganizationId or you extend DeviceManager to parse org from responses (current sample code leaves it to explicit setter).
  • Race with preload — Ensure DeviceCheck preload runs before UI that reads ScenarioDataConfig.

Unity Editor

DeviceManager component on prefab or bootstrap object; or Device Check UI in scene.

DeviceManager in Unity Inspector or device check UI