public override void Enter()
    {
        base.Enter();
        Debug.Log("STATE: Ledge Climb");

        _movement.MoveY(_data.LedgeHopAmount);
        _sfx.LedgeCatchSFX.PlayOneShot(_movement.Position);
    }
Beispiel #2
0
    public override void Enter()
    {
        base.Enter();

        Debug.Log("STATE: Jump");
        _animator.PlayAnimation(PlayerAnimator.JumpName);

        _input.JumpPressed   += OnJumpPressed;
        _input.JumpReleased  += OnJumpReleased;
        _input.DashPressed   += OnDashPressed;
        _input.AttackPressed += OnAttackPressed;

        _isJumpLocked = true;

        _movement.MoveY(_data.JumpVelocity);
        _sfx.JumpSFX?.PlayOneShot(_player.transform.position);
        _jumpDust?.Play();
    }
Beispiel #3
0
    public override void FixedUpdate()
    {
        base.FixedUpdate();

        float newSlideVelocity = -(_data.WallSlideVelocity + _accelerationAmount);

        _movement.MoveY(newSlideVelocity);
        _accelerationAmount += _data.WallSlideAcceleration;
    }
Beispiel #4
0
    public override void Enter()
    {
        base.Enter();

        Debug.Log("STATE: Air Jump");
        _animator.PlayAnimation(PlayerAnimator.JumpName);

        _input.AttackPressed += OnAttackPressed;
        _input.JumpReleased  += OnJumpReleased;
        _input.DashPressed   += OnDashPressed;

        _player.DecreaseAirJumpsRemaining();

        _movement.SetVelocityYZero();
        _movement.MoveY(_data.AirJumpVelocity);

        _sfx.AirJumpSFX?.PlayOneShot(_player.transform.position);
        _jumpDust?.Play();
    }
Beispiel #5
0
    public override void FixedUpdate()
    {
        base.FixedUpdate();

        _aboveWallDetector.Detect();

        _movement.MoveY(_data.WallClimbVelocity);

        if (_aboveWallDetector.IsDetected == false && _data.AllowLedgeHop)
        {
            // space above wall, if wall in front of us it's an upper ledge!
            if (_wallDetector.Detect() != null)
            {
                _stateMachine.ChangeState(_stateMachine.LedgeClimbState);
                return;
            }
        }
    }
Beispiel #6
0
 private void OnAttackPressed()
 {
     _movement.MoveY(_movement.Velocity.y * _data.AirAttackVelocityYDampen);
     _stateMachine.ChangeState(_stateMachine.AirAttackState);
 }