Conversation

This commit is contained in:
2025-05-06 11:25:27 -05:00
parent b9f0295722
commit a3c2c65735
8 changed files with 92 additions and 16 deletions

View File

@@ -0,0 +1,26 @@
class_name EventWithChildren extends "res://scripts/Events/Event.gd"
var childEvents:Array[Event] = []
func _init() -> void:
super._init()
_updateChildEvents()
_updateChildEvents()
self.child_entered_tree.connect(onChildEntered)
self.child_exiting_tree.connect(onChildExited)
self.child_order_changed.connect(onChildOrderChanged)
func _updateChildEvents() -> void:
childEvents = []
for child in get_children():
if child is Event:
childEvents.append(child)
func onChildEntered(child:Node) -> void:
_updateChildEvents()
func onChildExited(child:Node) -> void:
_updateChildEvents()
func onChildOrderChanged() -> void:
_updateChildEvents()