public void DeflectPerfeclty(float multiplier) { // Starts as random SetStartingDeflectionState(); // If the enemy was killed in the process...we try to get another enemy, if it is the last one we make it look like random SetTarget(enemyBulletOwner); if (target == null) { AI_Master AI = FindObjectOfType <AI_Master>(); if (AI != null) { Transform newEnemy = AI.GetClosestEnemy(transform.position); if (newEnemy != null) { SetTarget(newEnemy); } } } ; if (target == null) { SetRandomDirection(); Instantiate(particlesWhenBouncedRandomly, transform.position, transform.rotation); return; } SetPerfectDirection(multiplier); ChangeColor(); Instantiate(particlesWhenBouncedPerfectly, transform.position, transform.rotation); AUD_Manager.SetSwitch("Parry", "Success", gameObject); AUD_Manager.PostEvent("PC_Perry_ST", gameObject); bouncedPerfectly = true; }
private void Awake() { mHealth = mBase.mMaxHealth; rBody = GetComponent <Rigidbody>(); mGun = GetComponentInChildren <WP_Gun>(); mMaster = FindObjectOfType <AI_Master>(); mMaster.mNPCList.Add(this); mMover = GetComponent <AI_Mover>(); mState = STATE.COMBAT; mStateChange = STATE.COMBAT; mOrienter = GetComponent <AI_Orienter>(); mPlayersCam = Camera.main; mMoveToGoal = GetComponent <AI_MoveToGoal>(); }
}//end OnDisable() private void SetInitReferences() { AIManagerMaster = this.GetComponent <AI_Master>(); playerManagerMaster = GameObject.Find("Player").GetComponent <PM_Master>(); }//end setInitReferences()
private void Awake() { mPushObjs = FindObjectsOfType <LVL_PushObj>(); mMaster = GetComponent <AI_Controller>().mMaster; }
}//end OnDisable() private void SetInitReferences() { AIManagerMaster = GameObject.Find("Enemy_EvilPlayer").GetComponent <AI_Master>(); }//end setInitReferences()