Inheritance: MonoBehaviour
Ejemplo n.º 1
0
    private IEnumerator CreateFireZoneCoroutine()
    {
        FireZone fireZone = null;

        do
        {
            fireZone = _fireZones[Random.Range(0, _fireZones.Length)];
        }while (fireZone == null || _activeFireZones.Contains(fireZone) || _creatingFireZones.Contains(fireZone));

        _creatingFireZones.Add(fireZone);

        yield return(new WaitForSeconds(_timeBetweenFireZones.Evaluate(_time)));

        fireZone.value = _fireZonesValue.Evaluate(_time);

        fireZone.enabled = true;

        _creatingFireZones.Remove(fireZone);
        _activeFireZones.Add(fireZone);
        _gameOverCoroutines.Add(fireZone, StartCoroutine(GameOverCoroutine()));
    }