using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.XR.Management; namespace Unity.XR.MockHMD { /// /// Build-time settings for MockHMD provider. /// [XRConfigurationData("MockHMD", MockHMDBuildSettings.BuildSettingsKey)] public class MockHMDBuildSettings : ScriptableObject { public const string BuildSettingsKey = "xr.sdk.mock-hmd.settings"; /// /// Stereo rendering mode. /// public enum RenderMode { /// /// Submit separate draw calls for each eye. /// MultiPass, /// /// Submit one draw call for both eyes. /// SinglePassInstanced, }; /// /// Stereo rendering mode. /// public RenderMode renderMode; /// /// Runtime access to build settings. /// public static MockHMDBuildSettings Instance { get { MockHMDBuildSettings settings = null; #if UNITY_EDITOR UnityEngine.Object obj = null; UnityEditor.EditorBuildSettings.TryGetConfigObject(BuildSettingsKey, out obj); if (obj == null || !(obj is MockHMDBuildSettings)) return null; settings = (MockHMDBuildSettings) obj; #else settings = s_RuntimeInstance; if (settings == null) settings = new MockHMDBuildSettings(); #endif return settings; } } #if !UNITY_EDITOR /// Static instance that will hold the runtime asset instance we created in our build process. public static MockHMDBuildSettings s_RuntimeInstance = null; void OnEnable() { s_RuntimeInstance = this; } #endif } }