private void UpdateCellVariables() { bool waterBeside = CheckNeighbours(); _currentWeather = Database.Instance.Weather.GetRandomWeather(); _currentGrass = Database.Instance.Grass.UpdateGrass(_environment.Type, _currentWeather.SunnyIntensity, _currentWeather.RainyIntensity, _currentGrass, waterBeside); _cellUI.UpdateUI(_currentWeather.SunnyIntensity, _currentWeather.RainyIntensity, _currentGrass); }
public CurrentWeather GetRandomWeather() { CurrentWeather newWeather = new CurrentWeather(); int rainyIntensity, sunnyIntensity = _minWeatherIntensity; rainyIntensity = Config.GetRandomValue(_minWeatherIntensity, _maxWeatherIntensity, true); if (rainyIntensity == _maxWeatherIntensity) { sunnyIntensity = _minWeatherIntensity; } else { sunnyIntensity = Config.GetRandomValue(_minWeatherIntensity, _maxWeatherIntensity, true); if (sunnyIntensity == _maxWeatherIntensity) { rainyIntensity = _minWeatherIntensity; } } newWeather.RainyIntensity = rainyIntensity; newWeather.SunnyIntensity = sunnyIntensity; return(newWeather); }
private void Awake() { _currentWeather = new CurrentWeather(); }
private void InitUIVariables() { _currentWeather = Database.Instance.Weather.GetRandomWeather(); _cellUI.UpdateUI(_currentWeather.SunnyIntensity, _currentWeather.RainyIntensity, _currentGrass); }