private void Awake() { _aiHealth = GetComponent <Health>(); _audioSource = GetComponent <AudioSource>(); _owningZone = GetComponentInParent <CombatZone>(); _defaultMoveSpeed = GetComponent <NavMeshAgent>().speed; _lastKnownLocation = FindObjectOfType <LastKnownLocation>(); //Error Logging if (!_aiHealth) { Debug.LogError(gameObject.name + " has no derivative of Health Component attached to it"); } if (!_audioSource) { Debug.LogError(gameObject.name + " has no AudioSource component attached to it"); } if (!_owningZone) { Debug.LogError(gameObject.name + " has no CombatZone component in parent GameObject"); } }
public void Start() { combateZone = FindTheCombatZone(); Initialize(); }
public void StartSpawn(CombatZone combatZone) { _combatZone = combatZone; Timing.RunCoroutine(_Spawn()); }