/* Functions */ private void Awake() { mRandomMultiSoundAction = this.GetComponent <JCS_SoundPoolAction>(); // assign default spawn point if (mSpawnPoint == null) { mSpawnPoint = this.transform; } // try to get the ability format it own if (mAbilityFormat == null) { this.mAbilityFormat = this.GetComponent <JCS_AbilityFormat>(); } // try to get the detect area action it own if (mDetectAreaAction == null) { this.mDetectAreaAction = this.GetComponent <JCS_DetectAreaAction>(); } // try to get the player if (mPlayer == null) { this.mPlayer = this.GetComponent <JCS_2DSideScrollerPlayer>(); } }
//======================================== // Unity's function //------------------------------ private void Awake() { // try to get the ability format from this object. mAbilityFormat = this.GetComponent <JCS_AbilityFormat>(); mLiveObject = this.GetComponent <JCS_2DLiveObject>(); mLiveObjectList = new List <JCS_2DLiveObject>(); }
//======================================== // Unity's function //------------------------------ private void Awake() { mShootAction = this.GetComponent <JCS_ShootAction>(); // override the shoot effect in the base one. mShootAction.OverrideShoot = true; mThread = new JCS_Vector <int>(); mTimers = new JCS_Vector <float>(); mShootCount = new JCS_Vector <int>(); mShootCounter = new JCS_Vector <int>(); mShootPos = new JCS_Vector <Vector3>(); mTargetsPerSequence = new JCS_Vector <Transform>(); mShootDirection = new JCS_Vector <bool>(); // try to get the ability format. if (mAbilityFormat == null) { mAbilityFormat = this.GetComponent <JCS_AbilityFormat>(); } }
//======================================== // Unity's function //------------------------------ private void Awake() { // try to get it own transform's componenet. if (mAbilityFormat == null) { mAbilityFormat = this.GetComponent <JCS_AbilityFormat>(); } if (mAttackRange != null) { // range must be trigger mAttackRange.isTrigger = true; // disable the trigger EndAttack(); // set defualt attack animation spawn transform. if (mAtkAnimSpawnTrans == null) { // defualt as the collider's transform. mAtkAnimSpawnTrans = mAttackRange.transform; } } // try to get the action from the attack range. if (mApplyDamageTextAction == null) { this.mApplyDamageTextAction = this.GetComponentInChildren <JCS_ApplyDamageTextToLiveObjectAction>(); } if (mSoundPlayer == null) { this.mSoundPlayer = this.GetComponent <JCS_SoundPlayer>(); } // record down the time mRecordTimeToAttackTime = mTimeToActTime; mRecordActTime = mActTime; }
/* 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; }