void Awake() { _pathFinder = GetComponent<NavMeshAgent>(); _playerTransform = GameObject.FindGameObjectWithTag("Player").GetComponent<Transform>(); _enemyAudio = GetComponent<AudioSource>(); _meleeAnimator = GetComponent<Animator>(); _attackAnimation = Animator.StringToHash("Attack"); stunParticles.Stop(); _lunging = false; _stunned = false; _pathFinder.stoppingDistance = this.stoppingDistance; _knightManagerRef = GameObject.FindObjectOfType(typeof(KnightManager)) as KnightManager; _knightManagerRef.addEnemyToList ((MeleeEnemy)this); }
void Awake() { _pathFinder = GetComponent <NavMeshAgent>(); _playerTransform = GameObject.FindGameObjectWithTag("Player").GetComponent <Transform>(); _enemyAudio = GetComponent <AudioSource>(); _meleeAnimator = GetComponent <Animator>(); _attackAnimation = Animator.StringToHash("Attack"); stunParticles.Stop(); _lunging = false; _stunned = false; _pathFinder.stoppingDistance = this.stoppingDistance; _knightManagerRef = GameObject.FindObjectOfType(typeof(KnightManager)) as KnightManager; _knightManagerRef.addEnemyToList((MeleeEnemy)this); }