fix sky
This commit is contained in:
@@ -12,6 +12,9 @@ signal weather_state_exited(state: WeatherProfile.WeatherState)
|
||||
@export var weather_profiles: Array[WeatherProfile] = []
|
||||
@export var current_weather: WeatherProfile.WeatherState = WeatherProfile.WeatherState.CLEAR:
|
||||
set(value):
|
||||
if _changing_weather:
|
||||
current_weather = value
|
||||
return
|
||||
if value != current_weather:
|
||||
_request_weather_change(value)
|
||||
|
||||
@@ -39,6 +42,7 @@ var _random_weather_timer: float = 0.0
|
||||
var _next_weather_change: float = 0.0
|
||||
var _timeline_index: int = 0
|
||||
var _timeline_timer: float = 0.0
|
||||
var _changing_weather: bool = false
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
@@ -175,7 +179,9 @@ func set_weather(state: WeatherProfile.WeatherState, transition_duration: float
|
||||
weather_state_exited.emit(_current_profile.weather_state)
|
||||
|
||||
var old_state := current_weather
|
||||
_changing_weather = true
|
||||
current_weather = state
|
||||
_changing_weather = false
|
||||
_target_profile = profile
|
||||
|
||||
if transition_duration < 0:
|
||||
@@ -199,7 +205,9 @@ func set_weather_immediate(state: WeatherProfile.WeatherState) -> void:
|
||||
weather_state_exited.emit(_current_profile.weather_state)
|
||||
|
||||
var old_state := current_weather
|
||||
_changing_weather = true
|
||||
current_weather = state
|
||||
_changing_weather = false
|
||||
_current_profile = profile
|
||||
_target_profile = profile
|
||||
_is_transitioning = false
|
||||
|
||||
Reference in New Issue
Block a user