public PlayerMovement(Rigidbody2D rb, Transform transform, float speed, Animator anim) { _rb = rb; _transform = transform; _speed = speed; _runningParamId = Animator.StringToHash("Running"); AssertAnimator.HasParameter(_runningParamId, anim); Assert.IsFalse(anim.GetBool(_runningParamId)); _anim = anim; }
public PlayerJump(Rigidbody2D rb, Transform groundCheck, LayerMask whatIsGround, float jumpYVelocity, float jumpTime, Animator anim) { _groundCheck = groundCheck; _whatIsGround = whatIsGround; _jumpYVelocity = jumpYVelocity; _rb = rb; _jumpTime = jumpTime; _jumpingParamID = Animator.StringToHash("Jumping"); AssertAnimator.HasParameter(_jumpingParamID, anim); Assert.IsFalse(anim.GetBool(_jumpingParamID)); _anim = anim; ResetJumpCounter(); }