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

        _movement.MoveY(_data.LedgeHopAmount);
        _sfx.LedgeCatchSFX.PlayOneShot(_movement.Position);
    }
Ejemplo n.º 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();
    }
Ejemplo n.º 3
0
    public override void FixedUpdate()
    {
        base.FixedUpdate();

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

        _movement.MoveY(newSlideVelocity);
        _accelerationAmount += _data.WallSlideAcceleration;
    }
Ejemplo n.º 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();
    }
Ejemplo n.º 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;
            }
        }
    }
Ejemplo n.º 6
0
 private void OnAttackPressed()
 {
     _movement.MoveY(_movement.Velocity.y * _data.AirAttackVelocityYDampen);
     _stateMachine.ChangeState(_stateMachine.AirAttackState);
 }