using System.Collections.Generic; using System.Runtime.InteropServices; using UnityEngine.Experimental.XR; using UnityEngine.XR; using UnityEngine.XR.Management; namespace Unity.XR.MockHMD { /// /// Loader for Mock HMD. /// public class MockHMDLoader : XRLoaderHelper { private static List s_DisplaySubsystemDescriptors = new List(); private static List s_InputSubsystemDescriptors = new List(); public override bool Initialize() { CreateSubsystem(s_DisplaySubsystemDescriptors, "MockHMD Display"); CreateSubsystem(s_InputSubsystemDescriptors, "MockHMD Head Tracking"); var buildSettings = MockHMDBuildSettings.Instance; if (buildSettings != null) { MockHMD.SetRenderMode(buildSettings.renderMode); } return true; } public override bool Start() { StartSubsystem(); StartSubsystem(); return true; } public override bool Stop() { StopSubsystem(); StopSubsystem(); return true; } public override bool Deinitialize() { DestroySubsystem(); DestroySubsystem(); return true; } } }