internal static SRDProjectSettings GetDefault()
 {
     if (_instance != null)
     {
         _instance = null;
     }
     _instance = ScriptableObject.CreateInstance <SRDProjectSettings>();
     _instance.RunWithoutSRDisplay = false;
     return(_instance);
 }
        /// <summary>
        /// Static function to get SRDProjectSettings
        /// </summary>
        /// <returns>SRDProjectSettings instance</returns>
        public static SRDProjectSettings LoadResourcesOrDefault()
        {
            if (_instance != null)
            {
                return(_instance);
            }

            _instance = Resources.Load <SRDProjectSettings>("SRDProjectSettings");
            if (_instance != null)
            {
                return(_instance);
            }

            return(SRDProjectSettings.GetDefault());
        }
        private bool UpdateState(ref bool appState)
        {
            if (SRDProjectSettings.IsRunWithoutSRDisplayMode())
            {
                return(true);
            }

            var handle = SRDSessionHandler.SessionHandle;
            var result = SRDCorePlugin.GetActiveStateCrosstalkCorrection(handle, out var pluginState);

            if (result != SrdXrResult.SUCCESS)
            {
                Debug.LogWarning(string.Format("Failed to set CrosstalkCorrection setting: {0}", result));
            }
            else if (appState != pluginState)
            {
                Debug.LogWarning("CrosstalkCorrection setting is not changed. Check your UserSettings.ini");
            }

            appState = _previousFrameActiveState = pluginState;
            return(result == SrdXrResult.SUCCESS);
        }
示例#4
0
        public static void PopupMessageAndForceToTerminate(string message, bool forceToTerminate = true)
        {
            if (SRDProjectSettings.IsRunWithoutSRDisplayMode())
            {
                return;
            }

            if (forceToTerminate && Application.isPlaying)
            {
                message += ("\n" + SRDHelper.SRDMessages.AppCloseMessage);
                SRDCorePlugin.ShowMessageBox("Error", message, Debug.LogError);

#if UNITY_EDITOR
                UnityEditor.EditorApplication.isPlaying = false;
#else
                Application.Quit();
#endif
            }
            else
            {
                SRDCorePlugin.ShowMessageBox("Error", message, Debug.LogError);
            }
        }
 /// <summary>
 /// Just returns current RunWithoutSRDisplay
 /// </summary>
 /// <returns> A flag that shows RunWithoutSRDisplay is ON or not </returns>
 public static bool IsRunWithoutSRDisplayMode()
 {
     return(SRDProjectSettings.LoadResourcesOrDefault().RunWithoutSRDisplay);
 }