private static void ReceiveNativeEvent(OpenXRFeature.NativeEvent e, ulong payload)
        {
            var loader = Instance;

            if (loader != null)
            {
                loader.currentOpenXRState = e;
            }

            switch (e)
            {
            case OpenXRFeature.NativeEvent.XrRestartRequested:
                OpenXRRestarter.Instance.ShutdownAndRestart();
                break;

            case OpenXRFeature.NativeEvent.XrReady:
                loader.StartInternal();
                break;

            case OpenXRFeature.NativeEvent.XrFocused:
                DiagnosticReport.DumpReport("System Startup Completed");
                break;

            default:
                break;
            }

            OpenXRFeature.ReceiveNativeEvent(e, payload);

            if ((loader == null || !loader.isStarted) && e != OpenXRFeature.NativeEvent.XrInstanceChanged)
            {
                return;
            }

            switch (e)
            {
            case OpenXRFeature.NativeEvent.XrStopping:
                loader.StopInternal();
                break;

            case OpenXRFeature.NativeEvent.XrExiting:
                OpenXRRestarter.Instance.Shutdown();
                break;

            case OpenXRFeature.NativeEvent.XrLossPending:
                OpenXRRestarter.Instance.ShutdownAndRestart();
                break;

            case OpenXRFeature.NativeEvent.XrInstanceLossPending:
                OpenXRRestarter.Instance.Shutdown();
                break;

            default:
                break;
            }
        }
Пример #2
0
        private static void ReceiveNativeEvent(OpenXRFeature.NativeEvent e, ulong payload)
        {
            var loader = Instance;

            if (loader != null)
            {
                loader.currentOpenXRState = e;
            }

            switch (e)
            {
            case OpenXRFeature.NativeEvent.XrRestartRequested:
                CreateRestarter(loader, true);
                break;

            case OpenXRFeature.NativeEvent.XrReady:
                loader.StartInternal();
                break;

            case OpenXRFeature.NativeEvent.XrFocused:
                DiagnosticReport.DumpReport("System Startup Completed");
                break;

            default:
                break;
            }

            OpenXRFeature.ReceiveNativeEvent(e, payload);

            if ((loader == null || !loader.isStarted) && e != OpenXRFeature.NativeEvent.XrInstanceChanged)
            {
                return;
            }

            switch (e)
            {
            case OpenXRFeature.NativeEvent.XrInstanceChanged:
                OpenXRInput.InstanceHasChanged();
                OpenXRInput.SendActionDataToProvider();
                break;

            case OpenXRFeature.NativeEvent.XrSessionChanged:
                OpenXRInput.CreateActionsAndSuggestedBindings();
                OpenXRInput.AttachActionSetsToSession();
                break;

            case OpenXRFeature.NativeEvent.XrStopping:
                loader.StopInternal();
                break;

            case OpenXRFeature.NativeEvent.XrExiting:
                CreateRestarter(loader, false);
                break;

            case OpenXRFeature.NativeEvent.XrLossPending:
                CreateRestarter(loader, true);
                break;

            case OpenXRFeature.NativeEvent.XrInstanceLossPending:
                OpenXRLoader.CreateRestarter(loader, false);
                break;

            default:
                break;
            }
        }