extends Control


export var to = true

var delete_after = false


func _ready():
	if to:
		$AnimationPlayer.play("to_black")
	else:
		$AnimationPlayer.play("from_black")
		delete_after = true


func _on_AnimationPlayer_animation_finished(anim_name):
	emit_signal("done")
	if delete_after:
		queue_free()
