immersive-home/app/content/ui/components/tabs/tabs_content.gd
2024-03-16 01:16:08 +01:00

23 lines
420 B
GDScript

extends Node3D
class_name TabsContent3D
@export var tabs: Tabs3D
var children: Array = []
func _ready():
children = get_children()
for child in children:
child.visible = true
if tabs.selected != null && tabs.selected.get_index() == child.get_index():
continue
remove_child(child)
tabs.on_select.connect(func(index):
for child in get_children():
remove_child(child)
add_child(children[index])
)