Beispiel #1
0
    // Update is called once per frame
    void Update()
    {
        //Interact
        if (m_interactControl.GetAxisOnce())
        {
            _interact.Activate(_interactDistance);
        }

        if (_buttonHold && m_interactControl.GetAxisBool())
        {
            _hold.HoldItem(_interactDistance, _holdDistance, _holdRadiusCheck, _physicsBasedHolding);
        }
        if (!_buttonHold && m_interactControl.GetAxisOnce())
        {
            _hold.ClickHoldItem(_interactDistance, _holdDistance, _physicsBasedHolding);
        }

        if (m_modifierLeftButton.GetAxisBool() && _hold.heldObject != null)
        {
            //Rotate Object
        }

        //Jump
        float jumpInput;
        float verticalJumpInput;

        //if ( _useInvertedControlsUpsideDown )
        //{
        if (Camera.main.GetComponent <CameraControl>().rotationY >= SettingsComponent.gl_InvertAngle || Camera.main.GetComponent <CameraControl>().rotationY <= -SettingsComponent.gl_InvertAngle)
        {
            jumpInput         = -m_jumpControl.GetAxis();
            verticalJumpInput = -m_playerVerticalInput.GetAxis();
        }
        else
        {
            jumpInput         = m_jumpControl.GetAxis();
            verticalJumpInput = m_playerVerticalInput.GetAxis();
        }
        //}
        //else
        //{
        //    jumpInput = m_jumpControl.GetAxis();
        //    verticalJumpInput = m_playerVerticalInput.GetAxis();
        //}

        float jumpBoost = _jump.HoldBoostF(jumpInput, gameObject, _jumpRadius, _jumpBoostMax);

        if (jumpBoost != 0 && jumpInput == 0)
        {
            _jump.BoostJump(gameObject, m_playerHorizontalInput.GetAxis(), verticalJumpInput);
        }

        //Wall Movement
        _wallMovement.WallMove(verticalJumpInput, m_playerHorizontalInput.GetAxis(), gameObject, _jumpRadius, _wallGlideSpeed);

        //ObjectiveHint
        if (m_objectiveHintControl.GetAxisBool())
        {
            _ui_objectiveText.PopUp();
            _ui_objectiveIcon.PopUp();
        }
    }