substantial work on saving and loading and hub mechanic

This commit is contained in:
Derek
2025-02-22 17:09:47 -06:00
parent 777063ddeb
commit 3ee1f261d1
31 changed files with 584 additions and 212 deletions

30
scripts/scene_changer.gd Normal file
View File

@@ -0,0 +1,30 @@
extends Area3D
@export var scene_path : String
@export var scene_name : String
@export var gamemode : gamemode
@export var scene_thumbnail : Texture2D
var active = false
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func _on_body_entered(body: Node3D) -> void:
if active:
if get_tree().current_scene.gamemode.load_save == true:
SaveLoad.save_game_data(get_tree().current_scene.get_name())
SaveLoad.save_persistent_data()
SignalBus.emit_signal("player_exiting_tree")
get_tree().change_scene_to_file(scene_path)
func _on_start_activation_timeout() -> void:
active = true