2025-07-01 17:18:25 +00:00
|
|
|
extends CanvasLayer
|
|
|
|
|
|
|
|
@onready var rect = $ColorRect as ColorRect
|
|
|
|
|
|
|
|
|
2025-07-01 18:02:22 +00:00
|
|
|
func _ready() -> void:
|
|
|
|
rect.material.set("shader_parameter/intensity", 0.0)
|
2025-07-01 17:18:25 +00:00
|
|
|
|
2025-07-01 18:02:22 +00:00
|
|
|
|
|
|
|
var tween: Tween
|
|
|
|
|
|
|
|
|
2025-08-14 07:40:33 +00:00
|
|
|
func dizzy(duration := 3.5, intensity := 1.5, ease_in_duration := 0.3, ease_out_duration := 0.3) -> void:
|
2025-07-01 18:02:22 +00:00
|
|
|
if duration < 0.6:
|
|
|
|
return
|
2025-07-01 17:18:25 +00:00
|
|
|
if tween and tween.is_valid():
|
|
|
|
tween.kill()
|
|
|
|
show()
|
|
|
|
tween = create_tween()
|
2025-08-14 07:40:33 +00:00
|
|
|
tween.tween_property(rect.material, "shader_parameter/intensity", intensity, ease_in_duration)
|
2025-07-01 18:02:22 +00:00
|
|
|
tween.tween_interval(duration - 0.6)
|
2025-08-14 07:40:33 +00:00
|
|
|
tween.tween_property(rect.material, "shader_parameter/intensity", 0.0, ease_out_duration).set_ease(Tween.EASE_OUT).set_trans(Tween.TRANS_CUBIC)
|
2025-07-02 18:29:39 +00:00
|
|
|
tween.finished.connect(hide)
|