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
|
|
|
|
|
|
|
|
|
|
|
|
func dizzy(duration := 3.5, intensity := 1.5):
|
|
|
|
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-07-01 18:02:22 +00:00
|
|
|
tween.tween_property(rect.material, "shader_parameter/intensity", intensity, 0.3)
|
|
|
|
tween.tween_interval(duration - 0.6)
|
|
|
|
tween.tween_property(rect.material, "shader_parameter/intensity", 0.0, 0.3)
|
2025-07-02 18:29:39 +00:00
|
|
|
tween.finished.connect(hide)
|