void Start() { Agent = GetComponent<NavMeshAgent>(); Attack = GetComponent<EnemyAttack>(); _enemyCharacter = GetComponent<EnemyCharacter>(); _health = _enemyCharacter.GetComponent<EnemyHealth>(); }
void Start() { Agent = GetComponent <NavMeshAgent>(); Attack = GetComponent <EnemyAttack>(); _enemyCharacter = GetComponent <EnemyCharacter>(); _health = _enemyCharacter.GetComponent <EnemyHealth>(); }
// Use this for initialization void Start() { _agent = GetComponent<NavMeshAgent>(); _character = GetComponent<EnemyCharacter>(); _health = _character.GetComponent<EnemyHealth>(); // Time between an attack is the length of time it takes for the animation to complete // This is divided by 2 here because the Attacking state doubles the speed of the animation, so that needs to be adjusted here too _timeBetweenAttack = (AttackAnimation.length / 2) / 4f; _agent.updateRotation = false; _agent.updatePosition = true; }
// Use this for initialization void Start() { _agent = GetComponent <NavMeshAgent>(); _character = GetComponent <EnemyCharacter>(); _health = _character.GetComponent <EnemyHealth>(); // Time between an attack is the length of time it takes for the animation to complete // This is divided by 2 here because the Attacking state doubles the speed of the animation, so that needs to be adjusted here too _timeBetweenAttack = (AttackAnimation.length / 2) / 4f; _agent.updateRotation = false; _agent.updatePosition = true; }