public override void Enter() { base.Enter(); Debug.Log("STATE: Ledge Climb"); _movement.MoveY(_data.LedgeHopAmount); _sfx.LedgeCatchSFX.PlayOneShot(_movement.Position); }
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(); }
public override void FixedUpdate() { base.FixedUpdate(); float newSlideVelocity = -(_data.WallSlideVelocity + _accelerationAmount); _movement.MoveY(newSlideVelocity); _accelerationAmount += _data.WallSlideAcceleration; }
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(); }
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; } } }
private void OnAttackPressed() { _movement.MoveY(_movement.Velocity.y * _data.AirAttackVelocityYDampen); _stateMachine.ChangeState(_stateMachine.AirAttackState); }