private void Awake() { sensor = GetComponentInChildren <PAIFrontSensor>(); movement = GetComponent <PAIMovement>(); rb = GetComponent <Rigidbody>(); target = transform.position; }
private void Awake() { _anim = GetComponent <Animator>(); _movement = GetComponent <PAIMovement>(); _agent = GetComponent <NavMeshAgent>(); _sensor = GetComponentInChildren <PAIFrontSensor>(); _enemy = GetComponent <PAIEnemy>(); _rb = GetComponent <Rigidbody>(); }
private void Start() { _anim = GetComponent <Animator>(); _player = GameObject.FindWithTag("Player"); _playerScript = _player.GetComponent <PlayerController>(); _movement = GetComponent <PAIMovement>(); _agent = GetComponent <NavMeshAgent>(); _sensor = GetComponentInChildren <PAIFrontSensor>(); _enemy = GetComponent <PAIEnemy>(); _rb = GetComponent <Rigidbody>(); _attack1Key = Pool.Instance.GetSharedPoolKey("Alien1Attack"); _attackHitKey = Pool.Instance.GetSharedPoolKey("AlienHitAttack"); }