/// <summary> /// Sets to idle state as well as signals that it's safe /// to spawn new weather. /// </summary> public void TurnOff() { if (currentWeather != null) { currentWeather.weather.SetActive(false); } cloudTransition = 0; transition = 0; totalTransition = 0; SetStormSatus(false); safeToPress = true; currentWeather = null; weatherState = Off; }
/// <summary> /// Starting point of weather cycle where weatherType is enabled /// </summary> /// <param name="weatherType">Weather type.</param> public void EnableWeather(WeatherInfo weatherType, float startTime, float weatherLength, float transitionLength, float cloudTransitionLength = 0, float?severity = null) { currentWeather = weatherType; SetSeverity(weatherType, severity); currentWeather.weather.SetActive(true); if (currentWeather.changesClouds) { cloudTransInTime = startTime; transInTime = cloudTransInTime + cloudTransitionLength; idleTime = transInTime + transitionLength; transOutTime = idleTime + weatherLength; cloudTransOutTime = transOutTime + transitionLength; stopTime = cloudTransOutTime + cloudTransitionLength; } else { transInTime = startTime; idleTime = transInTime + transitionLength; transOutTime = idleTime + weatherLength; stopTime = transOutTime + transitionLength; } safeToPress = false; weatherState = On; }