challenge-editor/scene/game_flow.gd

18 lines
561 B
GDScript3
Raw Normal View History

2024-09-19 12:04:52 +08:00
extends Control
@onready var back: TextureRect = $back
@onready var event: HBoxContainer = $bottom_container/event
const GAME_FLOW_EVENT = preload("res://scene/game_flow_event.tscn")
var scene_data:Dictionary
func _ready() -> void:
set_scene("scene_01")
func set_scene(id:String):
scene_data=Global.get_scene_data(id)
back.texture=Global.get_texture(scene_data["texture"])
for i in event.get_children():
i.queue_free()
for i in scene_data["quick_event"]:
var new_btn=GAME_FLOW_EVENT.instantiate()
event.add_child(new_btn)
new_btn.set_data(i)
pass