immersive-home/app/content/ui/components/tabs/tabs_content.gd

23 lines
420 B
GDScript3
Raw Normal View History

2024-01-23 18:48:13 +02:00
extends Node3D
class_name TabsContent3D
@export var tabs: Tabs3D
var children: Array = []
func _ready():
children = get_children()
for child in children:
child.visible = true
2024-01-24 18:43:44 +02:00
if tabs.selected != null && tabs.selected.get_index() == child.get_index():
continue
2024-01-23 18:48:13 +02:00
remove_child(child)
tabs.on_select.connect(func(index):
for child in get_children():
remove_child(child)
add_child(children[index])
)