MolcaSDK.VR.UIFile:
Assets/_MolcaSDK/_VR/Scripts/Fade/VRFadeManager.csType: RuntimeSubsystem (child on RuntimeManager prefab) Uses a fade material with
_FadeAmount (0 = clear, 1 = fully black). On non-additive scene loads, optionally fades from black after a short delay unless a managed load set SkipNextAutoFade.
When to use
UseVRFadeManager when you need:
- Scene transition cover — automatic fade-in after single-scene loads (unless skipped).
- Manual fades — black out before loading, or reveal after async work (coordinate with ScenarioSessionManager / loaders that call
SkipNextAutoFadeto avoid double fades).
Inspector setup
| Field | Purpose |
|---|---|
| Fade speed | Default duration when FadeInAsync / FadeOutAsync use -1 for duration. |
| Fade material | Material with _FadeAmount; required — init logs error if null. |
| Scene start fade delay | Seconds to wait after scene load before FadeOutAsync in auto path. |
IsActive); otherwise fade methods return early.
Code
Manual fade around your own scene load (callSkipNextAutoFade first if you also use single-mode LoadScene and want to avoid the built-in auto fade):
LoadSceneAsync or Addressables load so you do not rely on a non-existent ToAwaitable helper.
Snap opacity:
API (key members)
| Member | Description |
|---|---|
Instance | RuntimeManager.GetSubsystem<VRFadeManager>() |
FadeInAsync(float duration = -1) | Lerps _FadeAmount toward 1 (to black). |
FadeOutAsync(float duration = -1) | Lerps toward 0 (clear). |
SetFadeAmount(float amount) | Immediate clamped value. |
SetFadeAmountAsync(float targetAmount, float duration) | Animated change to target. |
GetFadeAmount() | Current shader value. |
GetFadeMaterial() | Assigned material (for camera/stack setup). |
IsTransitioning | True while an async fade runs. |
SkipNextAutoFade() | Next OnSceneLoaded skips automatic fade (for coordinated loads). |
Troubleshooting
- No fade, material error on init — Assign fade material on the subsystem; ensure
_FadeAmountexists on the shader. - Double fade or flash on session-driven loads — Call
SkipNextAutoFadebefore loads that already fade (e.g. session / loading manager flows). FadeInAsync/FadeOutAsyncreturn immediately — Another transition may be running (isTransitioning); or subsystem is inactive / not initialized.- Additive scenes — Auto fade bails for
LoadSceneMode.Additive; use manual fades if you need overlay behavior.
Related
- RuntimeManager — subsystem hosting
- Runtime subsystem — lifecycle
- ScenarioManager — completion fades (typical consumer)
Unity Editor
VRFadeManager on prefab with fade material reference.
