예제 #1
0
    protected virtual void Update()
    {
        _yAxis          = _input.GetInput()._veticalAxis;
        _jumpButtonDown = _input.GetInput()._jumpButtonDown;
        _jumpButton     = _input.GetInput()._jumpButton;
        _dashButtonDown = _input.GetInput()._dashButtonDown;
        _dashButton     = _input.GetInput()._dashButton;

        _grounded = _playerCheckBehaviour._onGround;
        if (!_damageBehaviour._hurt && _playerState.Equals(PlayerState.normal))
        {
            _gravity = 7f;
        }
        else
        {
            _gravity = 0f;
        }

        if (_movementBehaviour._canMove)
        {
            _movementBehaviour.DirectionalBehaviour(_xAxis);
            _jumpBehaviour.Jumping(_jumpButtonDown, _jumpButton, _xAxis);
            _dashBehaviour.Dashing(_dashButtonDown, _dashButton, _yAxis);
        }

        if (_damageBehaviour._hurt.Equals(false))
        {
            _playerState = _dashBehaviour._playerState;
        }
        else
        {
            _playerState = PlayerState.hit;
        }
    }