Class LoadingScreenCameraXRDepth
Keeps the loading screen camera from hiding the VR view.
[RequireComponent(typeof(Camera))]
public class LoadingScreenCameraXRDepth : MonoBehaviour
Inheritance
Remarks
The loading screen camera clears the screen to the loading background and is switched on with the CanvasScreenFadeBehaviour canvas for the whole transition. In VR it also renders into the headset, and at the same depth as the VR camera it can draw over the VR view.
While an XR device is active, this moves the camera below every other camera, so in the headset it only shows when no other camera renders, e.g. between unloading one scene and loading the next. Without an XR device the camera keeps its own depth, so the desktop loading screen is unchanged.