immersive-home/app/content/ui/components/tabs/tabs_content.gd
2024-04-09 17:11:24 +02:00

22 lines
367 B
GDScript

extends Node3D
class_name TabsContent3D
@export var tabs: Tabs3D
var children: Array = []
func _ready():
children = get_children()
for i in range(children.size()):
var child = children[i]
child.visible = true
remove_child(child)
R.effect(func(_arg):
if tabs.selected.value.get_index() == i:
add_child(child)
else:
remove_child(child)
)