Exemple #1
0
 private void Awake()
 {
     _view    = GetComponent <PAIView>();
     _roaming = GetComponent <PAIRoaming>();
     _enemy   = GetComponent <PAIEnemy>();
     _attack  = GetComponent <IPAIAttack>();
 }
Exemple #2
0
 private void Awake()
 {
     _anim     = GetComponent <Animator>();
     _movement = GetComponent <PAIMovement>();
     _agent    = GetComponent <NavMeshAgent>();
     _sensor   = GetComponentInChildren <PAIFrontSensor>();
     _enemy    = GetComponent <PAIEnemy>();
     _rb       = GetComponent <Rigidbody>();
 }
Exemple #3
0
        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");
        }
Exemple #4
0
        void Start()
        {
            _master = GetComponent <PAIEnemy>();

            if (gameObject.name.Contains("Enemy1"))
            {
                _foundPlayerKey = Pool.Instance.GetSharedPoolKey("Alien1FoundPlayer");
                _patrolSoundKey = Pool.Instance.GetSharedPoolKey("Alien1Patrol");
            }
            else if (gameObject.name.Contains("Enemy2"))
            {
                _foundPlayerKey = Pool.Instance.GetSharedPoolKey("Alien2FoundPlayer");
                _patrolSoundKey = Pool.Instance.GetSharedPoolKey("Alien2Patrol");
            }

            _patrolSoundTimestamp = Random.Range(15f, 30f);
            _nextPatrolSound     += _patrolSoundTimestamp;
        }