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

22 lines
382 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):
2024-05-10 14:16:17 +03:00
if tabs.selected.value == i:
2024-04-09 18:11:24 +03:00
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)
)