14 lines
304 B
GDScript
14 lines
304 B
GDScript
extends Button
|
|
|
|
@export var scene_name: String
|
|
|
|
|
|
func _ready() -> void:
|
|
connect("pressed", _on_Button_pressed)
|
|
|
|
|
|
func _on_Button_pressed() -> void:
|
|
if not scene_name:
|
|
push_error("Scene to switch to is not configured")
|
|
return
|
|
get_tree().change_scene_to_file("res://scenes/" + scene_name + ".tscn")
|