2025-06-24 17:52:30 +00:00
|
|
|
extends CanvasLayer
|
|
|
|
|
|
|
|
|
|
|
|
func _ready() -> void:
|
|
|
|
layer = GlobalConfig.CANVAS_LAYER_EFFECT
|
|
|
|
|
|
|
|
|
2025-07-10 16:29:46 +00:00
|
|
|
func run_effect(half_duration := 0.7, wait_time := 0.5):
|
2025-06-24 17:52:30 +00:00
|
|
|
if not is_node_ready():
|
|
|
|
await ready
|
|
|
|
var rect = $ColorRect as ColorRect
|
|
|
|
var tween = create_tween()
|
|
|
|
rect.modulate.a = 0
|
|
|
|
tween.tween_property(rect, "modulate:a", 1.0, half_duration)
|
2025-07-10 16:29:46 +00:00
|
|
|
tween.tween_interval(wait_time)
|
2025-06-24 17:52:30 +00:00
|
|
|
tween.tween_property(rect, "modulate:a", 0.0, half_duration)
|
|
|
|
tween.tween_callback(queue_free)
|