コード例 #1
0
        private void Init()
        {
            var inputSource = InputShellMap.Instance.inputSwitchLogic.CurrentTargetingSource;
            var type        = inputSource.GetType();

            InputSourceText.SetText(string.Format("Source: {0}", type));
        }
コード例 #2
0
        protected override void AddInputListeners()
        {
            InputSources.Instance.hands.OnFingerPressed  += OnFingerPressed;
            InputSources.Instance.hands.OnFingerReleased += OnFingerReleased;
            InputSources.Instance.hands.OnHandEntered    += OnHandEntered;
            InputSources.Instance.hands.OnHandLeft       += OnHandLeft;
            InputSources.Instance.hands.OnHandMoved      += OnHandMoved;
            InputSources.Instance.hands.OnMenuChanged    += OnMenuChanged;
            InputSources.Instance.hands.OnSelectChanged  += OnSelectChanged;

            HandMovingLabel.SetText("Not Moving");
        }
コード例 #3
0
        private void OnSourceChanged(InputSourceGamepad arg1, InputSourceGamepadBase newSource)
        {
            if (newSource != null)
            {
                m_SourceName.SetText(newSource.GetType().ToString());
            }
            else
            {
                m_SourceName.SetText("No Gamepad Source");
            }

            m_SourceName.Highlight();
        }
コード例 #4
0
 //--------------------------------------------------------------------
 private void SetAxisMessage(TextItem textItem, string axisName, float axisValue)
 {
     if (textItem != null)
     {
         textItem.SetText(axisName + ": " + axisValue.ToString("F3"));
         textItem.Highlight();
     }
 }
コード例 #5
0
        private void Update()
        {
            var hand1WorldPosition = InputSources.Instance.hands.GetWorldPosition(0);
            if (hand1WorldPosition == Vector3.forward)
            {
                Hand1PositionLabel.SetText("Not Present");
            }
            else
            {
                Hand1PositionLabel.SetText(string.Format("POS: {0}", hand1WorldPosition));
            }

            var hand2WorldPosition = InputSources.Instance.hands.GetWorldPosition(1);
            if (hand2WorldPosition == Vector3.forward)
            {
                Hand2PositionLabel.SetText("Not Present");
            }
            else
            {
                Hand2PositionLabel.SetText(string.Format("POS: {0}", hand2WorldPosition));
            }
        }