void Start() { this.enemy = this.GetComponent <CharacterController> (); this.enemyPhysics = this.GetComponent <EnemyController>(); this.enemyAnimation = this.GetComponent <Animator> (); this.enemySight = this.GetComponent <Sight>(); this.behaviourTree = createBehaviourTree(); this.enemyWeaponController = this.GetComponent <FireEnemyWeapon> (); this.behaviourState = new BehaviourContext(enemy, enemyPhysics, enemyAnimation, enemySight, enemyRange, enemyWeaponController, enemyCloseRange); }
public BehaviourContext(CharacterController enemy, EnemyController enemyPhy, Animator enemyAn, Sight sight, float range, FireEnemyWeapon eWC, float eCloseRange) { this.enemy = enemy; this.enemyPhysics = enemyPhy; this.enemyAnimation = enemyAn; this.enemySight = sight; this.enemyRange = range; this.enemyWeaponController = eWC; this.closeRange = eCloseRange; pathNodes = GameObject.FindGameObjectsWithTag("PathNode"); planeNodes = PathFinder.getPathNodePlanes(pathNodes); }
void Awake() { getOriginalColors(); waveController = GameObject.FindObjectOfType <WaveController> (); scoreController = GameObject.FindObjectOfType <GameController> (); this.enemy = this.GetComponent <CharacterController> (); this.enemyAnimation = this.GetComponent <Animator> (); this.enemyAnimation.speed = enemyAnimationSpeed; if (enemyType == "Soldier") { enemyWeapon = this.GetComponent <FireEnemyWeapon> (); } modEnemyStats(); }