コード例 #1
0
    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");
        }
    }
コード例 #2
0
 public void Start()
 {
     combateZone = FindTheCombatZone();
     Initialize();
 }
コード例 #3
0
 public void StartSpawn(CombatZone combatZone)
 {
     _combatZone = combatZone;
     Timing.RunCoroutine(_Spawn());
 }