public override bool ShouldActivateModule()
        {
            if (!base.ShouldActivateModule())
            {
                return(false);
            }

            var shouldActivate = m_ForceModuleActive;

            InputManager.GetButtonDown(m_SubmitButton);
            shouldActivate |= InputManager.GetButtonDown(m_CancelButton);
            shouldActivate |= !Mathf.Approximately(InputManager.GetAxisRaw(m_HorizontalAxis), 0.0f);
            shouldActivate |= !Mathf.Approximately(InputManager.GetAxisRaw(m_HorizontalAxis_2), 0.0f);
            shouldActivate |= !Mathf.Approximately(InputManager.GetAxisRaw(m_VerticalAxis), 0.0f);
            shouldActivate |= !Mathf.Approximately(InputManager.GetAxisRaw(m_VerticalAxis_2), 0.0f);
            shouldActivate |= (m_MousePosition - m_LastMousePosition).sqrMagnitude > 0.0f;
            shouldActivate |= InputManager.GetMouseButtonDown(0);


            for (int i = 0; i < InputManager.touchCount; ++i)
            {
                Touch input = InputManager.GetTouch(i);

                shouldActivate |= input.phase == TouchPhase.Began ||
                                  input.phase == TouchPhase.Moved ||
                                  input.phase == TouchPhase.Stationary;
            }
            return(shouldActivate);
        }
Ejemplo n.º 2
0
        public override bool ShouldActivateModule()
        {
            if (!base.ShouldActivateModule())
            {
                return(false);
            }

            var shouldActivate = InputManager.GetButtonDown(m_SubmitButton);

            shouldActivate |= InputManager.GetButtonDown(m_CancelButton);
            shouldActivate |= !Mathf.Approximately(InputManager.GetAxisRaw(m_HorizontalAxis), 0.0f);
            shouldActivate |= !Mathf.Approximately(InputManager.GetAxisRaw(m_VerticalAxis), 0.0f);
            shouldActivate |= (m_MousePosition - m_LastMousePosition).sqrMagnitude > 0.0f;
            shouldActivate |= InputManager.GetMouseButtonDown(0);
            return(shouldActivate);
        }
Ejemplo n.º 3
0
 public static bool GetMouseButtonDown(int button)
 {
     return(InputManager.GetMouseButtonDown(button));
 }