private void Awake() { _gunFirePossition = transform.Find("GunPossition").transform; _health = _maxHealth; if (gameObject.name.Contains("EnemyInfantry")) { _enemyType = _enemyTypes.Infantry; } if (gameObject.name.Contains("Turret")) { _enemyType = _enemyTypes.Turret; } if (gameObject.name.Contains("Tank")) { _enemyType = _enemyTypes.Tank; } if (_enemyType != _enemyTypes.Turret) { _navMesh = GetComponent <NavMeshAgent>(); } //_currentPoint = 0; _player = GameObject.FindGameObjectWithTag("Player"); _playerInForwardLook = false; if (_enemyType == _enemyTypes.Infantry) { _animator = gameObject.GetComponent <Animator>(); _animator.SetBool("InfantryGo", false); } }
public void AssignEnemyLaser(string enemyTypes) { _isEnemyLaser = true; _enemyTypesSelected = (_enemyTypes)Enum.Parse(typeof(_enemyTypes), enemyTypes); }