Client/scripts/ui/switch_to_scene.gd
Snoweuph a4261f9e2b
All checks were successful
Build Application / build (tower_defence_web, build/*, build, build/index.html, Web) (push) Successful in 14s
Build Application / build (tower_defence.elf, tower_defence.elf, tower_defence.elf, Linux) (push) Successful in 18s
Build Application / build (tower_defence.exe, tower_defence.exe, tower_defence.exe, Windows) (push) Successful in 19s
Build Application / build-docker (push) Successful in 10s
Build Application / release (push) Successful in 10s
chore: setup
2025-01-31 19:20:10 +01:00

13 lines
270 B
GDScript

extends Button
@export var scene: PackedScene
func _ready() -> void:
connect("pressed", _on_Button_pressed)
pass
func _on_Button_pressed() -> void:
if not scene:
push_error("Scene to switch to is not configured")
get_tree().change_scene_to_packed(scene)
pass