Exemplo n.º 1
0
    IEnumerator WaitForWeatherData()
    {
        _weatherData = _weatherController.GetCurrentData();
        while (_weatherData == null)
        {
            yield return(new WaitForSeconds(1));

            _weatherData = _weatherController.GetCurrentData();
        }
        _currentWeatherSetting     = FindWeatherSetting(_weatherData);
        DayNightAffected.FolowTime = !_currentWeatherSetting.Name.Equals("thunderstorm");

        _mistImage.SetActive(_currentWeatherSetting.CloudFrequency < 0);
        _cloudMovement.SpawningClouds((_currentWeatherSetting.CloudFrequency > 0) ? true : false, _currentWeatherSetting.CloudFrequency, _currentWeatherSetting.AmountOfDrops, _currentWeatherSetting.Snow);
        if (_currentWeatherSetting.Name.Contains("thunder"))
        {
            _thunderFlash.StartFlashing();
        }
        else
        {
            _thunderFlash.StopFlashing();
        }
    }