extends CanvasLayer
onready var animation_player = $AnimationPlayer
func transition_to_scene(scene_to_trans: String, unpause_tree: bool = false) -> void:
animation_player.play('default')
yield(animation_player, "animation_finished")
get_tree().current_scene.queue_free()
if unpause_tree: get_tree().paused = false
get_tree().change_scene(scene_to_trans)
animation_player.play_backwards('default')
yield(animation_player, "animation_finished")
$ColorRect.visible = false
get_tree().paused = false