extends Control

@onready var animation = $AnimationPlayer as AnimationPlayer

var color_material : ShaderMaterial
@export var duration : float:
	set(value):
		if color_material:color_material.set_shader_parameter("position",value)
		
func _ready():
	color_material = $ColorRect.material as ShaderMaterial
	SignalManager.level_loading_start.connect(on_level_loading_start)
	SignalManager.level_loading_end.connect(on_level_loading_end)

func on_level_loading_start():
	animation.play("start")
	
func on_level_loading_end():
	animation.play("end")
	
