Esempio n. 1
0
        /* Methods */
        void Start()         //Initialization method
        {
            m_Animator      = GetComponent <Animator>();
            m_Rigidbody     = GetComponent <Rigidbody>();
            m_Character     = this.gameObject.transform.GetChild(0);
            m_Capsule       = GetComponent <CapsuleCollider>();
            m_CapsuleHeight = m_Capsule.height;
            m_CapsuleCenter = m_Capsule.center;

            m_Rigidbody.constraints   = RigidbodyConstraints.FreezePositionX | RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationY | RigidbodyConstraints.FreezeRotationZ;
            m_OrigGroundCheckDistance = m_GroundCheckDistance;
            m_IsGrounded = true;             //Assumes the character originally on ground (Can change when it checks grounded status)

            m_Health           = 100;
            m_GameManager      = GameObject.FindWithTag("GameController");
            m_ManagerMechanics = m_GameManager.GetComponent <Mechanics> ();
            m_AudioMethods     = GetComponent <MainCharacterAudio> ();
        }