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.
- Listed in Other Alta assemblies
- Inherits or implements
IInitializable,IXRLoaderInitializer
Constructors
| Member | What it is |
|---|---|
WindowsXRLoaderInitializer(IWindowsXRLoaderSettings settings, IXRManagerSettingsController xrManagerController, IEnumerable<IXRSupportSystem> xrSupportSystems) | Creates a WindowsXRLoaderInitializer from settings, xrManagerController and xrSupportSystems. |
Fields
5 private and internal fields
| Member | What it is |
|---|---|
private static readonly Logger logger | NLog logger for this class. |
private TownshipXRMode mode | The XR mode picked at startup. |
private readonly IWindowsXRLoaderSettings settings | Injected settings with the editor XR mode and loader assets. |
private readonly IXRManagerSettingsController xrManagerController | Injected controller that starts and stops the XR manager. |
private readonly IEnumerable<IXRSupportSystem> xrSupportSystems | Injected support systems; those valid for the mode are preconfigured before start. |
Methods
6 private and internal methods
| Member | What 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. |