Skip to content

Commit

Permalink
Add "transition_finished" signal on initial load for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
jabsatz committed Apr 6, 2022
1 parent 6e6857f commit e476780
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion addons/scene_manager/SceneManager.gd
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ var singleton_entities = {}
func _ready():
_set_singleton_entities()
call_deferred("emit_signal", "scene_loaded")
call_deferred("emit_signal", "transition_finished")


func _set_singleton_entities():
Expand Down Expand Up @@ -136,7 +137,10 @@ func _get_final_options(initial_options: Dictionary):

return options


var _previous_scene = null


func _process(_delta):
if not is_instance_valid(_previous_scene) and _tree.current_scene:
_previous_scene = _tree.current_scene
Expand All @@ -145,7 +149,7 @@ func _process(_delta):
emit_signal("scene_loaded")
if _tree.current_scene != _previous_scene:
_previous_scene = _tree.current_scene


func change_scene(path, setted_options: Dictionary = {}):
var options = _get_final_options(setted_options)
Expand Down

0 comments on commit e476780

Please sign in to comment.