Skip to main content

WindowsXRLoaderInitializer

A class in Alta.XRManagement.Windows, Alta.XRLoaders.

PC startup service (VContainer) that picks OpenXR, Valve OpenVR or no VR, swaps the XR loaders to match, runs support systems and starts the XR manager.

Constructors​

MemberWhat it is
WindowsXRLoaderInitializer(IWindowsXRLoaderSettings settings, IXRManagerSettingsController xrManagerController, IEnumerable<IXRSupportSystem> xrSupportSystems)Creates a WindowsXRLoaderInitializer from settings, xrManagerController and xrSupportSystems.

Fields​

5 private and internal fields
MemberWhat it is
private static readonly Logger loggerNLog logger for this class.
private TownshipXRMode modeThe XR mode picked at startup.
private readonly IWindowsXRLoaderSettings settingsInjected settings with the editor XR mode and loader assets.
private readonly IXRManagerSettingsController xrManagerControllerInjected controller that starts and stops the XR manager.
private readonly IEnumerable<IXRSupportSystem> xrSupportSystemsInjected support systems; those valid for the mode are preconfigured before start.

Methods​

MemberWhat it is
static void __ForceNoStripping()Never called. References SteamVR and OpenVR helpers so the build does not strip them.
async void Initialize()Waits for the XR manager, then sets up the loaders. Called by VContainer at startup.
6 private and internal methods
MemberWhat it is
private void ConfigureNoVR(XRManagerSettings manager, bool hasValve, bool hasOpenXr)Removes the OpenVR and OpenXR loaders if present.
private void ConfigureOpenXr(XRManagerSettings manager, bool hasValve, bool hasOpenXr)Removes the OpenVR loader and adds the OpenXR loader if missing.
private void ConfigureRuntime(XRManagerSettings manager, TownshipXRMode mode)Applies the loader set for the mode, then initializes the loader for any VR mode.
private void ConfigureValve(XRManagerSettings manager, bool hasOpenXr, bool hasValve)Removes the OpenXR loader and adds the OpenVR loader if missing. Logs an error when the add succeeds, the check is inverted.
private async Task InitializeWindowsLoaders(XRManagerSettings manager)Shuts down any running XR, reads the mode (editor setting or command line), and unless no VR, configures loaders, support systems and the manager.
private void TryRemoveLoader(XRManagerSettings manager, string loaderName)Removes the active loader with the given type name. Throws if none matches.