//======================================== // 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 override void Awake() { base.Awake(); this.mSpriteRenderer = this.GetComponent <SpriteRenderer>(); this.m2DAnimator = this.GetComponent <JCS_2DAnimator>(); // try to get this component in this transform. if (mVelocityInfo == null) { mVelocityInfo = this.GetComponent <JCS_VelocityInfo>(); } if (mAbilityFormat == null) { mAbilityFormat = this.GetComponent <JCS_AbilityFormat>(); } if (mAttackRecorder == null) { mAttackRecorder = this.GetComponent <JCS_AttackerRecorder>(); } // auto detect to see if this gameobject player or not. JCS_Player p = this.GetComponent <JCS_Player>(); // if found it return true! if (p != null) { mIsPlayer = true; } else { mIsPlayer = false; } // set hp the same mPreCalHP = HP; }