1
Fork 0
mirror of https://github.com/RYGhub/the-cold-night.git synced 2024-11-22 04:34:19 +00:00

🔧 Add intensity_changed signal to Fire

This commit is contained in:
Steffo 2022-04-03 00:14:43 +02:00
parent ff39de119a
commit beb9485ee4
Signed by: steffo
GPG key ID: 6965406171929D01

View file

@ -6,6 +6,7 @@ export var change_per_second: float = - 1.0 / 60.0
export var min_intensity: float = 0 export var min_intensity: float = 0
export var max_intensity: float = INF export var max_intensity: float = INF
signal intensity_changed(value)
signal intensity_at_max signal intensity_at_max
signal intensity_at_min signal intensity_at_min
var intensity_reached_max_triggered: bool = false var intensity_reached_max_triggered: bool = false
@ -19,6 +20,7 @@ func set_intensity(value):
# Update everything that needs to be updated when the intensity changes # Update everything that needs to be updated when the intensity changes
$Light.texture_scale = value $Light.texture_scale = value
# Trigger signals # Trigger signals
emit_signal("intensity_changed", intensity)
# max intensity signal # max intensity signal
if intensity == max_intensity: if intensity == max_intensity:
emit_signal("intensity_at_max") emit_signal("intensity_at_max")