Exemple #1
0
        //========================================
        //      Unity's function
        //------------------------------
        private void Awake()
        {
            mVelocityInfo            = this.GetComponent <JCS_VelocityInfo>();
            mCharacterControllerInfo = this.GetComponent <JCS_CharacterControllerInfo>();

            // try to get the component in the same transform
            if (mLiveObjectAnimator == null)
            {
                mLiveObjectAnimator = this.GetComponent <JCS_2DLiveObjectAnimator>();
            }
        }
        /* Functions */

        private void Awake()
        {
            this.mVelocityInfo = this.GetComponent<JCS_VelocityInfo>();
            this.mCharacterControllerInfo = this.GetComponent<JCS_CharacterControllerInfo>();

            // try to get the sound
            if (mSoundPlayer == null)
                this.mSoundPlayer = this.GetComponent<JCS_SoundPlayer>();

            // try to get the component in the same transform
            if (mAttackRecorder == null)
                mAttackRecorder = this.GetComponent<JCS_AttackerRecorder>();
            if (mLiveObjectAnimator == null)
                mLiveObjectAnimator = this.GetComponent<JCS_2DLiveObjectAnimator>();
        }
        /* Functions */

        protected virtual void Awake()
        {
            mCharacterController     = this.GetComponent <CharacterController>();
            mCharacterControllerInfo = this.GetComponent <JCS_CharacterControllerInfo>();
        }