try to reduce load times

This commit is contained in:
Michael Campbell 2026-04-30 01:29:02 -04:00
parent c54ccb4d4f
commit 457de8dcaa
8 changed files with 66 additions and 7 deletions

Binary file not shown.

View file

@ -1,12 +1,19 @@
extends Node
@export var shatter_scenes: Array[PackedScene]
@export var building_meshes: Array[PackedScene]
@export var building_scales: PackedVector3Array
var shatter_scene: PackedScene
func _ready() -> void:
var idx := randi_range(0, %Shaker.get_child_count() - 1)
for child in %Shaker.get_children():
child.visible = child.get_index() == idx
var idx := randi_range(0, building_meshes.size() - 1)
# for child in %Shaker.get_children():
# child.visible = child.get_index() == idx
var building_mesh: Node3D = building_meshes[idx].instantiate()
building_mesh.scale = building_scales[idx]
%Shaker.add_child(building_mesh)
shatter_scene = shatter_scenes[idx]
func _on_building_destroyed_from(global_pos: Vector3) -> void: