real-ezTheDev / GodotEzDialoguePlugin

MIT License
109 stars 10 forks source link

Efficiency advice #12

Closed Grrreggg closed 3 months ago

Grrreggg commented 3 months ago

DialogueBox.gd: create array to store buttons, instancing are resource heavy task, do not run it every time you need to update options.

func _ready():

for i in 10:
    var button = dialogue_choice_res.instantiate()
    button.dialogue_selected.connect(_on_choice_button_down)
    button.text = ''
    button.choice_id = -1
    button.hide()
    add_child(button)
    choices_buttons.push_back(button)
real-ezTheDev commented 3 months ago

This is a fair advice! Thanks!