Save/Load rework
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
extends Control
|
||||
|
||||
@onready var fading_mask = $FadingMask
|
||||
@onready var mask = $Mask
|
||||
|
||||
signal transition_finished
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
pass
|
||||
|
||||
|
||||
#Transitions the scenes with a fading mask
|
||||
func transition(scenes_to_hide, scenes_to_show):
|
||||
|
||||
#Fade in
|
||||
fading_mask.fade_in()
|
||||
await fading_mask.animation.animation_finished
|
||||
|
||||
#Hides and show appropriates scenes
|
||||
for scene in scenes_to_hide:
|
||||
scene.hide()
|
||||
for scene in scenes_to_show:
|
||||
scene.show()
|
||||
|
||||
#Fade out
|
||||
fading_mask.fade_out()
|
||||
await fading_mask.animation.animation_finished
|
||||
transition_finished.emit()
|
||||
Reference in New Issue
Block a user