private bool isDead; //if the enemy is dead //initialises variables and references void Start() { currentHP = maxHP; resistances = new float[] { fireResistance, waterResistance, airResistance, earthResistance, orderResistance, chaosResistance, 0f }; textList = GameObject.Find("DamageNumbersList").transform; gameController = GameObject.Find("GameController").transform; avoidanceController = GetComponent <IEnemyAvoidanceController>(); }
private bool avoiding; //if the enemy is currently trying to avoid player projetiles //initialising varibles void Start() { player = GameObject.FindGameObjectWithTag("Player"); spellController = GetComponent <IEnemySpellController> (); moveController = GetComponent <IEnemyMoveController>(); avoidanceController = GetComponent <IEnemyAvoidanceController>(); nextFire = Time.time + 3f; //small delay before firing so they don't shoot the second the player enters the room gameController = GameObject.Find("GameController").transform; playerMovement = player.GetComponent <PlayerMoveController>(); }