示例#1
0
        public override bool ShouldActivateModule()
        {
            if (!base.ShouldActivateModule())
            {
                return(false);
            }

            var shouldActivate = m_ForceModuleActive;

            shouldActivate |= InputController.GetKeyDown(submitCode);
            shouldActivate |= InputController.GetKeyDown(cancelCode);
            shouldActivate |= !Mathf.Approximately(InputController.GetAxis(horizontalCode), 0.0f);
            shouldActivate |= !Mathf.Approximately(InputController.GetAxis(verticalCode), 0.0f);
            shouldActivate |= (m_MousePosition - m_LastMousePosition).sqrMagnitude > 0.0f;
            shouldActivate |= input.GetMouseButtonDown(0);

            if (input.touchCount > 0)
            {
                shouldActivate = true;
            }

            return(shouldActivate);
        }
示例#2
0
 public void RefreshHash()
 {
     keyNegativeHash  = InputController.GetHash(keyNegative);
     keyPositiveHash  = InputController.GetHash(keyPositive);
     joystickAxisHash = InputController.GetHash(joystickAxis);
 }