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

22 lines
394 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()
2024-04-09 18:11:24 +03:00
for i in range(children.size()):
var child = children[i]
2024-01-23 18:48:13 +02:00
child.visible = true
remove_child(child)
2024-04-09 18:11:24 +03:00
R.effect(func(_arg):
if tabs.selected.value.get_index() == i:
add_child(child)
2024-04-26 15:42:30 +03:00
elif child.get_parent() == self:
2024-04-09 18:11:24 +03:00
remove_child(child)
)