Skip to main content

Shared module

Folder: Assets/_MolcaSDK/Code/Scripts/Preload/
TypeRole
PreloadCheckRuns child checks in order
IPreloadCheckInterface each gate implements
FirstLaunchCheckFirst-run gate

VR

VRPreloadCheckAssets/_MolcaSDK/_VR/Scripts/UI/VRPreloadCheck.cs — same child IPreloadCheck pattern for Preload VR scene.

Code

Each gate implements IPreloadCheck and runs async work in RunCheck() (see FirstLaunchCheck in the same folder):
using MolcaSDK.Preload;
using UnityEngine;

public class DeviceCapabilityGate : MonoBehaviour, IPreloadCheck
{
    public async Awaitable RunCheck()
    {
        await Awaitable.NextFrameAsync();
        if (!HasRequiredDevice())
            Debug.LogError("[Preload] Device capability check failed.");
    }

    private static bool HasRequiredDevice() => true; // replace with XR / platform checks
}
Wire PreloadCheck / VRPreloadCheck in the Hierarchy so children run in order (Inspector remains the source of truth for ordering).

Unity Editor

Preload VR scene hierarchy: VRPreloadCheck with child DeviceCheck / checks expanded.

VRPreloadCheck and child preload checks in Hierarchy