système de sauvegarde, scène 3D de test sur la base astra et passage en forward+
This commit is contained in:
@@ -7,7 +7,6 @@ signal scene_node_ready(scene : Scene)
|
||||
|
||||
var loading_scene = false
|
||||
var generating_node = false
|
||||
var actual_scene : Scene = null
|
||||
var next_scene_node : Node
|
||||
@onready var current_scene_node : Node = get_tree().root.get_children().back()
|
||||
|
||||
@@ -30,7 +29,7 @@ func change_scene(scene_id : String, with_loading = true):
|
||||
if not scene:
|
||||
printerr("Scene %s not found" % scene_id)
|
||||
return
|
||||
actual_scene = scene
|
||||
GameInfo.game_data.actual_scene = scene
|
||||
loading_scene = true
|
||||
var scene_path_to_load = scene.scene_path
|
||||
ResourceLoader.load_threaded_request(scene_path_to_load)
|
||||
@@ -70,11 +69,11 @@ func change_scene(scene_id : String, with_loading = true):
|
||||
func _process(_delta):
|
||||
if loading_scene:
|
||||
var progress = []
|
||||
var load_status := ResourceLoader.load_threaded_get_status(actual_scene.scene_path, progress)
|
||||
var load_status := ResourceLoader.load_threaded_get_status(GameInfo.game_data.actual_scene.scene_path, progress)
|
||||
LoadingScreen.loading_value = progress[0]
|
||||
if load_status == ResourceLoader.THREAD_LOAD_LOADED:
|
||||
loading_scene = false
|
||||
scene_loaded.emit(actual_scene)
|
||||
scene_loaded.emit(GameInfo.game_data.actual_scene)
|
||||
if load_status == ResourceLoader.THREAD_LOAD_FAILED or load_status == ResourceLoader.THREAD_LOAD_INVALID_RESOURCE:
|
||||
printerr()
|
||||
elif generating_node:
|
||||
@@ -85,4 +84,4 @@ func _process(_delta):
|
||||
scene_node_ready.emit()
|
||||
elif next_scene_node.is_node_ready():
|
||||
generating_node = false
|
||||
scene_node_ready.emit(actual_scene)
|
||||
scene_node_ready.emit(GameInfo.game_data.actual_scene)
|
||||
|
||||
Reference in New Issue
Block a user