func _speak(dialogue):
Interaction.say_dialogue(dialogue)
yield(Interaction, "interaction_completed")
func handle_interaction() -> void:
_speak("hello 1")
_speak("hello 2")
Calling yield in the first call of _speak()
doesn't wait until the interaction is being completed. Is there a sophisticated way to solve this issue with signals?
The problem is mostly about code design.
func handle_interaction() -> void:
Interaction.say_dialogue("hello 1")
yield(Interaction, "interaction_completed")
Interaction.say_dialogue("hello 2")
yield(Interaction, "interaction_completed")
This looks like ugly code, specially if I have many things that a character says. Can this be solved with yield
or should I go with the good old is_finished
checks?