xrjamfeb2025/scenes/scene_select_button.gd
2025-02-15 20:15:58 -07:00

16 lines
394 B
GDScript

class_name SceneSelectButton
extends Button
@export_file('*.tscn') var scene_path : String
func _ready():
pressed.connect(_on_pressed)
func _on_pressed():
var root = get_tree().current_scene
print("Current scene root: ", root)
if root is XRToolsStaging:
print("Loading scene: ", scene_path)
root.load_scene(scene_path)
else:
print("Root scene is not XRToolsStaging, got: ", root)