class_name QuestSystem extends Node var _quest_states:Array = [] # Called when the node enters the scene tree for the first time. func _ready(): _quest_states = get_tree().get_nodes_in_group("quest_state") DialogueManager.connect("dialogue_ended", _on_dialogue_ended) func _on_dialogue_ended(_dialog_resource: DialogueResource): for quest_state in _quest_states: if quest_state.has_method("on_dialogue_ended"): quest_state.on_dialogue_ended(_dialog_resource)