コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
 private void Awake()
 {
     _currentWeather = new CurrentWeather();
 }
コード例 #4
0
 private void InitUIVariables()
 {
     _currentWeather = Database.Instance.Weather.GetRandomWeather();
     _cellUI.UpdateUI(_currentWeather.SunnyIntensity, _currentWeather.RainyIntensity, _currentGrass);
 }