protected virtual void Show(ViewingState viewingState)
        {
            switch (viewingState)
            {
            case ViewingState.Status:
                RemoveCreatedChooseButtons();
                UpdateCurrentText();
                selectionPanel.gameObject.SetActive(false);
                statusPanel.gameObject.SetActive(true);

                break;

            case ViewingState.Selection:
                AddSelectionButtons();
                selectionPanel.gameObject.SetActive(true);
                statusPanel.gameObject.SetActive(false);

                break;

            default:
                VRTK_Logger.Fatal(new ArgumentOutOfRangeException("viewingState", viewingState, null));
                return;
            }

            bool isAnyOtherCameraUsed = VRTK_SDKManager.GetAllSDKSetups().Any(setup => setup != null && setup.gameObject.activeSelf) ||
                                        VRTK_DeviceFinder.HeadsetCamera() != null;

            fallbackCamera.gameObject.SetActive(!isAnyOtherCameraUsed);
            eventSystem.gameObject.SetActive(EventSystem.current == null || EventSystem.current == eventSystem);
        }
Пример #2
0
        protected virtual void Show(ViewingState viewingState)
        {
            switch (viewingState)
            {
            case ViewingState.Status:
                RemoveCreatedChooseButtons();
                UpdateCurrentText();
                selectionPanel.gameObject.SetActive(false);
                statusPanel.gameObject.SetActive(true);

                break;

            case ViewingState.Selection:
                AddSelectionButtons();
                selectionPanel.gameObject.SetActive(true);
                statusPanel.gameObject.SetActive(false);

                break;

            default:
                VRTK_Logger.Fatal(new ArgumentOutOfRangeException("viewingState", viewingState, null));
                return;
            }

            fallbackCamera.gameObject.SetActive(Camera.main == null || Camera.main == fallbackCamera);
            eventSystem.gameObject.SetActive(EventSystem.current == null || EventSystem.current == eventSystem);
        }