started work on async loading

This commit is contained in:
derek
2025-03-22 20:01:43 -05:00
parent c1746a92cb
commit 8447589c82
7 changed files with 540 additions and 38 deletions

View File

@@ -1,4 +1,3 @@
@tool
extends Node3D
@export var sun_color : GradientTexture1D
@@ -19,7 +18,7 @@ func change_sun():
sun.rotation.x = sun_details["angle"]
sun.rotation.y = north_offset
sun.light_energy = sun_details["energy"]
moon.light_energy = (2 - sun_details["energy"]) * .25
moon.light_energy = (2 - sun_details["energy"]) * .5
func sun_angle_from_time():
var time_dict = Time.get_time_dict_from_system()

View File

@@ -6,7 +6,7 @@ class_name Portal
@export var level_gamemode : gamemode
@export var scene_thumbnail : Texture2D
@export var hub_portal : bool = false
const ENEMY_WORKING_SCENE_ASYNCTEST = preload("res://scenes/enemy_working_scene_ASYNCTEST.tscn")
var timer_active = false
var active = true
var index : int
@@ -24,21 +24,28 @@ func _process(delta: float) -> void:
func _on_body_entered(body: Node3D) -> void:
if body.is_in_group("player"):
if active and timer_active:
#Let the Bounds detector know player is exiting
SignalBus.emit_signal("player_exiting_tree")
if hub_portal:
#add back other portals to round portal array
GameGlobals.current_match[GameGlobals.current_round_id].remove_at(index)
#Set incoming gamemode
GameGlobals.loading_gamemode = level_gamemode
#Save data
if get_tree().current_scene.gamemode.load_save == true:
SaveLoad.save_game_data(get_tree().current_scene.get_name())
SaveLoad.save_user_data()
get_tree().change_scene_to_file(scene_path)
active = false
var scene = ENEMY_WORKING_SCENE_ASYNCTEST.instantiate()
scene.global_basis = global_basis
scene.global_position = global_position
scene.rotation = rotation
scene.scale = Vector3.ONE
add_child(scene)
##Let the Bounds detector know player is exiting
#SignalBus.emit_signal("player_exiting_tree")
#
#if hub_portal:
##add back other portals to round portal array
#GameGlobals.current_match[GameGlobals.current_round_id].remove_at(index)
##Set incoming gamemode
#GameGlobals.loading_gamemode = level_gamemode
##Save data
#if get_tree().current_scene.gamemode.load_save == true:
#SaveLoad.save_game_data(get_tree().current_scene.get_name())
#SaveLoad.save_user_data()
#get_tree().change_scene_to_file(scene_path)
else:
body.velocity = -body.velocity * 2
body.velocity = -body.velocity * 1.1
func _on_start_activation_timeout() -> void: