class_name SceneTransitions
extends CanvasLayer

signal done

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

var animation_name = ''

func reset():
	animation_player.play_backwards(animation_name)
	emit_signal("done")
	
func transition_dissolve() -> void:
	animation_name = 'dissolve'
	animation_player.play('dissolve')
	yield(animation_player,'animation_finished')
	emit_signal("done")


func transition_clouds() -> void:
	animation_name = 'clouds_out'
	animation_player.play('clouds_in')
	yield(animation_player,'animation_finished')
	emit_signal("done")

