private const float k_DeadZoneAngleDeg = 1.15f; // The number of degrees below which rotation is not animated. public override void Init(Animator anim) { // Setting up the groundedManager and component references. groundedManager.Init(anim, groundLayer); m_Transform = anim.transform; m_CameraRig = userInput.cameraRig; m_Camera = userInput.mainCamera; // Setting the dead zone in radians based on the dead zone in degrees. m_DeadZoneAngleRad = k_DeadZoneAngleDeg * Mathf.Deg2Rad; }
private const float k_SpeedMargin = 0.1f; // Margin below which grounded can become true. public override void Init(Animator anim) { // Setting up the grounded manager and rigidbody reference. m_GroundedManager.Init(anim, groundLayer); m_Rigidbody = anim.GetComponent <Rigidbody>(); }
private readonly int m_HashMidairTag = Animator.StringToHash("Midair"); // For referencing the animator states tagged Midair. public override void Init(Animator anim) { // Setting up the grounded manager. m_GroundedManager.Init(anim, groundLayer); }
public override void OnEnabled(Animator anim) { groundLayer = player.groundLayer; groundedManager.Init(anim, groundLayer); }