workaround
This commit is contained in:
parent
ac4909f180
commit
fffd53a267
File diff suppressed because one or more lines are too long
@ -58,8 +58,8 @@ func _enter_tree() -> void:
|
|||||||
# 仅在编辑器中调试时,通过 main 场景启动
|
# 仅在编辑器中调试时,通过 main 场景启动
|
||||||
if GlobalConfig.DEBUG and (not Engine.is_editor_hint()) and (not get_parent() is GroundLoader):
|
if GlobalConfig.DEBUG and (not Engine.is_editor_hint()) and (not get_parent() is GroundLoader):
|
||||||
print("restarting...")
|
print("restarting...")
|
||||||
call_deferred("_restart_from_main")
|
|
||||||
restarting= true
|
restarting= true
|
||||||
|
_restart_from_main()
|
||||||
return
|
return
|
||||||
if camera_focus_marker:
|
if camera_focus_marker:
|
||||||
camera_focus_marker.enabled = true
|
camera_focus_marker.enabled = true
|
||||||
@ -88,18 +88,15 @@ func _ready() -> void:
|
|||||||
|
|
||||||
|
|
||||||
func _restart_from_main():
|
func _restart_from_main():
|
||||||
|
# _enter_tree, wait for ready
|
||||||
|
await ready
|
||||||
|
if not ArchiveManager.archive:
|
||||||
|
ArchiveManager.load_archive()
|
||||||
|
if not GlobalConfigManager.config:
|
||||||
|
ArchiveManager.load_config()
|
||||||
ArchiveManager.archive.current_scene = scene_name
|
ArchiveManager.archive.current_scene = scene_name
|
||||||
ArchiveManager.archive.entrance_portal = default_portal
|
ArchiveManager.archive.entrance_portal = default_portal
|
||||||
get_tree().change_scene_to_packed(preload("res://scene/main.tscn"))
|
get_tree().change_scene_to_packed.call_deferred(preload("res://scene/main.tscn"))
|
||||||
|
|
||||||
# var main = get_tree().current_scene
|
|
||||||
# # if not main.is_node_ready():
|
|
||||||
# # await main.ready
|
|
||||||
# var ground_loader = main.get_node("./GroundLoader") as GroundLoader
|
|
||||||
# # ground_loader.ignore_archive = true
|
|
||||||
# ground_loader.ignore_archive = false
|
|
||||||
# ground_loader.force_archive_scene = scene_name
|
|
||||||
# ground_loader.force_archive_portal = default_portal
|
|
||||||
|
|
||||||
|
|
||||||
func _reset_player_y():
|
func _reset_player_y():
|
||||||
|
Loading…
Reference in New Issue
Block a user