extends CanvasLayer

signal done

#func change_scene(target: String, type: String = 'dissolve') -> void:
#	if type == 'dissolve':
#		transition_dissolve(target)
#	else:
#		transition_clouds(target)

var animation_name = ''

func reset():
	$AnimationPlayer.play_backwards(animation_name)
	emit_signal("done")
	
func transition_dissolve(target: String) -> void:
	animation_name = 'dissolve'
	$AnimationPlayer.play('dissolve')
	yield($AnimationPlayer,'animation_finished')
	emit_signal("done")
	#get_tree().change_scene(target)
	#$AnimationPlayer.play_backwards('dissolve')

func transition_clouds(target: String) -> void:
	animation_name = 'clouds_out'
	$AnimationPlayer.play('clouds_in')
	yield($AnimationPlayer,'animation_finished')
	emit_signal("done")
	#get_tree().change_scene(target)
	#$AnimationPlayer.play('clouds_out')
