void Start() { nextAudibleCheck = Time.fixedTime + audibleCheckRate; stamina = maxStamina; staminaImage = ThirdPersonUIHandler.master.staminaImage; staminaRestrictionImage = ThirdPersonUIHandler.master.staminaRestrictionImage; tpHealth = GetComponent <ThirdPersonHealthManager> (); m_Animator = GetComponent <Animator> (); m_Rigidbody = GetComponent <Rigidbody> (); m_Capsule = GetComponent <CapsuleCollider> (); m_CapsuleHeight = m_Capsule.height; m_CapsuleCenter = m_Capsule.center; m_Rigidbody.constraints = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationY | RigidbodyConstraints.FreezeRotationZ; m_OrigGroundCheckDistance = m_GroundCheckDistance; }
private void Start() { // get the transform of the main camera if (Camera.main != null) { m_Cam = Camera.main.transform; } else { Debug.LogWarning( "Warning: no main camera found. Third person character needs a Camera tagged \"MainCamera\", for camera-relative controls.", gameObject); // we use self-relative controls in this case, which probably isn't what the user wants, but hey, we warned them! } // get the third person character ( this should never be null due to require component ) tpMotor = GetComponent <ThirdPersonCharacterMotor>(); tpAim = GetComponent <ThirdPersonAimAtMouse> (); tpHealth = GetComponent <ThirdPersonHealthManager> (); tpRagdoll = GetComponent <ThirdPersonRagdoll> (); }