Exemple #1
0
    private void UpdateInputs()
    {
        if (this.m_Player.GetRotationBlocked())
        {
            return;
        }
        this.m_Inputs.m_Vertical   = 0f;
        this.m_Inputs.m_Horizontal = 0f;
        if (InputsManager.Get().IsActionActive(InputsManager.InputAction.Forward))
        {
            this.m_Inputs.m_Vertical = 1f;
        }
        else if (InputsManager.Get().IsActionActive(InputsManager.InputAction.Backward))
        {
            this.m_Inputs.m_Vertical = -1f;
        }
        if (InputsManager.Get().IsActionActive(InputsManager.InputAction.Left))
        {
            this.m_Inputs.m_Horizontal = -1f;
        }
        else if (InputsManager.Get().IsActionActive(InputsManager.InputAction.Right))
        {
            this.m_Inputs.m_Horizontal = 1f;
        }
        Vector2 lookInput = InputHelpers.GetLookInput(this.m_LookSensitivityX, this.m_LookSensitivityY, 150f);

        this.m_Inputs.m_MouseX = lookInput.x;
        this.m_Inputs.m_MouseY = lookInput.y;
    }
Exemple #2
0
 private void UpdateInputs()
 {
     if (!Player.Get().GetMovesBlocked())
     {
         this.m_Inputs.m_Vertical   = InputsManager.Get().GetActionValue(InputsManager.InputAction.Forward) - InputsManager.Get().GetActionValue(InputsManager.InputAction.Backward);
         this.m_Inputs.m_Vertical   = Mathf.Sign(this.m_Inputs.m_Vertical) * (this.m_Inputs.m_Vertical * this.m_Inputs.m_Vertical);
         this.m_Inputs.m_Horizontal = InputsManager.Get().GetActionValue(InputsManager.InputAction.Right) - InputsManager.Get().GetActionValue(InputsManager.InputAction.Left);
         this.m_Inputs.m_Horizontal = Mathf.Sign(this.m_Inputs.m_Horizontal) * (this.m_Inputs.m_Horizontal * this.m_Inputs.m_Horizontal);
         this.m_Inputs.m_Jump       = InputsManager.Get().IsActionActive(InputsManager.InputAction.Jump);
         if (GreenHellGame.IsPadControllerActive() && HUDWheel.Get().m_Active)
         {
             this.m_Inputs.m_Duck = false;
         }
         if (GreenHellGame.Instance.m_Settings.m_ToggleRunOption == GameSettings.ToggleRunOption.No)
         {
             this.m_Inputs.m_Sprint = InputsManager.Get().IsActionActive(InputsManager.InputAction.Sprint);
         }
     }
     else if (!MainLevel.Instance.IsPause())
     {
         this.m_Inputs.m_Jump   = false;
         this.m_Inputs.m_Sprint = false;
     }
     if (!this.m_Player.GetRotationBlocked())
     {
         Vector2 lookInput = InputHelpers.GetLookInput(this.m_LookSensitivityX, this.m_LookSensitivityY, this.m_PadSensitivity);
         this.m_Inputs.m_MouseX = lookInput.x;
         this.m_Inputs.m_MouseY = lookInput.y;
     }
 }
    private void UpdateInputs()
    {
        this.m_Inputs.m_Horizontal = CrossPlatformInputManager.GetAxis("Horizontal");
        this.m_Inputs.m_Vertical   = CrossPlatformInputManager.GetAxis("Vertical");
        this.m_Inputs.m_Jump       = CrossPlatformInputManager.GetButton("Jump");
        this.m_Inputs.m_Duck       = CrossPlatformInputManager.GetButton("Duck");
        if (Input.GetKeyDown(KeyCode.LeftShift))
        {
            this.m_Inputs.m_Sprint = !this.m_Inputs.m_Sprint;
        }
        Vector2 lookInput = InputHelpers.GetLookInput(this.m_LookSensitivityX, this.m_LookSensitivityY, 150f);

        this.m_Inputs.m_MouseX = lookInput.x;
        this.m_Inputs.m_MouseY = lookInput.y;
    }
 private void UpdatInputs()
 {
     if (this.m_State == EBIMState.Rotation)
     {
         this.m_MouseAxisX -= InputHelpers.GetLookInput(this.m_MouseSensitivityX, 1f, 150f).x *Time.deltaTime;
         if (this.m_MouseAxisX < -30f)
         {
             this.m_MouseAxisX = -30f;
         }
         if (this.m_MouseAxisX > 30f)
         {
             this.m_MouseAxisX = 30f;
         }
         this.m_LMB = InputsManager.Get().IsActionActive(InputsManager.InputAction.LMB);
     }
 }
Exemple #5
0
    private void UpdateMouseMoves()
    {
        float x = InputHelpers.GetLookInput(10f, 1f, 150f).x;

        this.m_MouseX += x;
        if (this.m_CurrentDirection == Direction.Left)
        {
            if (this.m_MouseX < -this.m_Shift)
            {
                float num = this.GetSinMul(this.m_CurrentDirection);
                if (num < 0.8f)
                {
                    num *= 0.3f;
                }
                this.m_Shift            += this.m_ShiftIncrease * num;
                this.m_CurrentDirection  = Direction.Right;
                this.m_RightSinStartTime = Time.time;
            }
        }
        else if (this.m_CurrentDirection == Direction.Right && this.m_MouseX > this.m_Shift)
        {
            float num2 = this.GetSinMul(this.m_CurrentDirection);
            if (num2 < 0.8f)
            {
                num2 *= 0.3f;
            }
            this.m_Shift           += this.m_ShiftIncrease * num2;
            this.m_CurrentDirection = Direction.Left;
            this.m_LeftSinStartTime = Time.time;
        }
        this.m_Shift         -= this.m_ShiftDecreaseSpeedPerSec * Time.deltaTime;
        this.m_Shift          = Mathf.Clamp(this.m_Shift, 0f, this.m_MaxShift * 2f);
        this.m_MouseX         = Mathf.Clamp(this.m_MouseX, -this.m_Shift, this.m_Shift);
        this.m_DebugText.text = "MouseX = " + this.m_MouseX.ToString();
        Text debugText = this.m_DebugText;

        debugText.text = debugText.text + "\nShift = " + this.m_Shift.ToString();
    }