コード例 #1
0
        private void Start()
        {
            if (TBInput.GetControllerModel(controller) == VRController.None)
            {
                gameObject.SetActive(false);
                Debug.LogWarning("Finger chart was disabled because no controller was found for " + controller + ". Is that input type enabled in Input Settings?");
                return;
            }

            if (!TBInput.SupportsFinger(TBInput.Finger.Thumb, controller))
            {
                _thumb.enabled = false;
                _thumb.transform.parent.gameObject.SetActive(false);
            }
            if (!TBInput.SupportsFinger(TBInput.Finger.Index, controller))
            {
                _index.transform.parent.gameObject.SetActive(false);
                _index.enabled = false;
            }
            if (!TBInput.SupportsFinger(TBInput.Finger.Grip, controller))
            {
                _grip.transform.parent.gameObject.SetActive(false);
                _grip.enabled = false;
            }

            if (controller == TBInput.Controller.RHandController)
            {
                ToggleHandedness();
            }
        }
コード例 #2
0
        private IEnumerator Start()
        {
            if (TBInput.GetControllerModel(controller) == VRController.None)
            {
                Debug.Log("Input chart was disabled because no controller was found for " + controller + ". This means that the associated ControlType is disabled in TButt's Input Settings, or no compatible controller exists for the current platform.");
                gameObject.SetActive(false);
                yield break;
            }

            controllerLabel.text = controller.ToString() + " | " + TBInput.GetControllerModel(controller).ToString();
            _rect = GetComponent <RectTransform>();

            for (int i = 0; i < buttons.Count; i++)
            {
                if (TBInput.SupportsVirtualButton(buttons[i], controller))
                {
                    CreateDisplayRow(buttons[i]);
                }
            }

            ConformHeights();

            TBInput.ControlType assocaitedControlType = TBInput.ControlType.None;

            switch (controller)
            {
            case TBInput.Controller.LHandController:
            case TBInput.Controller.RHandController:
                assocaitedControlType = TBInput.ControlType.HandControllers;
                break;

            case TBInput.Controller.Mobile3DOFController:
                assocaitedControlType = TBInput.ControlType.Mobile3DOFController;
                break;

            case TBInput.Controller.Gamepad:
                assocaitedControlType = TBInput.ControlType.Gamepad;
                break;

            case TBInput.Controller.ClickRemote:
                assocaitedControlType = TBInput.ControlType.ClickRemote;
                break;
            }

            if (assocaitedControlType != TBInput.GetActiveControlType())
            {
                gameObject.GetComponent <Canvas>().enabled = false;

                while (TBInput.GetActiveControlType() == TBInput.ControlType.None)
                {
                    yield return(null);
                }

                if (assocaitedControlType == TBInput.GetActiveControlType())
                {
                    gameObject.GetComponent <Canvas>().enabled = true;
                }
            }
        }
コード例 #3
0
ファイル: TBSampleInputPanel.cs プロジェクト: tomires/jackout
        private void Start()
        {
            if (TBInput.GetControllerModel(controller) == VRController.None)
            {
                Debug.LogWarning("Input chart was disabled because no controller was found for " + controller + ". Is that input type enabled in Input Settings?");
                gameObject.SetActive(false);
                return;
            }

            controllerLabel.text = controller.ToString() + " | " + TBInput.GetControllerModel(controller).ToString();
            _rect = GetComponent <RectTransform>();

            for (int i = 0; i < buttons.Count; i++)
            {
                if (TBInput.SupportsVirtualButton(buttons[i], controller))
                {
                    CreateDisplayRow(buttons[i]);
                }
            }

            ConformHeights();
        }