예제 #1
0
        public InputSystem()
        {
            Implementation.Log("Initializing new InputSystem support...");

            m_kbCurrentProp = TKeyboard.GetProperty("current");
            m_kbIndexer     = TKeyboard.GetProperty("Item", new Type[] { TKey });

            var btnControl = ReflectionHelpers.GetTypeByName("UnityEngine.InputSystem.Controls.ButtonControl");

            m_btnIsPressedProp   = btnControl.GetProperty("isPressed");
            m_btnWasPressedProp  = btnControl.GetProperty("wasPressedThisFrame");
            m_btnWasReleasedProp = btnControl.GetProperty("wasReleasedThisFrame");

            m_mouseCurrentProp = TMouse.GetProperty("current");
            m_leftButtonProp   = TMouse.GetProperty("leftButton");
            m_rightButtonProp  = TMouse.GetProperty("rightButton");
            m_middleButtonProp = TMouse.GetProperty("middleButton");
            m_scrollProp       = TMouse.GetProperty("scroll");

            m_positionProp = ReflectionHelpers.GetTypeByName("UnityEngine.InputSystem.Pointer")
                             .GetProperty("position");

            m_readVector2InputMethod = ReflectionHelpers.GetTypeByName("UnityEngine.InputSystem.InputControl`1")
                                       .MakeGenericType(typeof(Vector2))
                                       .GetMethod("ReadValue");
        }
예제 #2
0
        public InputSystem()
        {
            m_kbCurrentProp = TKeyboard.GetProperty("current");
            m_kbIndexer     = TKeyboard.GetProperty("Item", new Type[] { TKey });

            var btnControl = ReflectionUtility.GetTypeByName("UnityEngine.InputSystem.Controls.ButtonControl");

            m_btnIsPressedProp  = btnControl.GetProperty("isPressed");
            m_btnWasPressedProp = btnControl.GetProperty("wasPressedThisFrame");

            m_mouseCurrentProp = TMouse.GetProperty("current");
            m_leftButtonProp   = TMouse.GetProperty("leftButton");
            m_rightButtonProp  = TMouse.GetProperty("rightButton");
            m_scrollDeltaProp  = TMouse.GetProperty("scroll");

            m_positionProp = ReflectionUtility.GetTypeByName("UnityEngine.InputSystem.Pointer")
                             .GetProperty("position");

            ReadV2ControlMethod = ReflectionUtility.GetTypeByName("UnityEngine.InputSystem.InputControl`1")
                                  .MakeGenericType(typeof(Vector2))
                                  .GetMethod("ReadValue");
        }