Пример #1
0
 private void Start()
 {
     _hp              = GetComponent <Enemy_HP>();
     _movement        = GetComponent <Enemy_Movement>();
     _searchForPlayer = GetComponent <Enemy_SearchForPlayer>();
     _wallCheck       = GetComponentInChildren <BasicEnemy_WallCheck>();
     _attack          = GetComponentInChildren <Enemy_Attack>();
     _attackTrigger   = GetComponentInChildren <Enemy_AttackTrigger>();
     _audioSource     = GetComponent <AudioSource>();
     _audioSource2    = _attack.GetComponent <AudioSource>();
 }
Пример #2
0
 // Use this for initialization
 void Start()
 {
     _playerMovement  = FindObjectOfType <Player_Movement>();
     _transform       = GetComponent <Transform>();
     _enemyController = GetComponent <Enemy_Controller>();
     _animator        = GetComponent <Animator>();
     _instance        = this;
     _wallCheck       = GetComponentInChildren <BasicEnemy_WallCheck>();
     _rigidBody2D     = GetComponent <Rigidbody2D>();
     _enemyAttack     = GetComponentInChildren <Enemy_Attack>();
     _player          = _playerMovement.GetComponent <Transform>();
 }