immersive-home/app/content/ui/components/tabs/tabs_content.gd
2024-05-10 13:16:17 +02:00

22 lines
382 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 == i:
add_child(child)
elif child.get_parent() == self:
remove_child(child)
)