Hey,
I want to add UI Elements based on a variable list of entities in my save file.
Currently I just have a "prepare" function on the main script of the scene I want to add but this seems a bit dirty and I need to write some extra lines to make sure it does not execute any logic before the data has been set. Is there a way so that when I do this:
extends PanelContainer
var knowledgeUIRef = preload("res://Game/UI/KnowledgeTab/knowledge_instance_panel.tscn")
func _ready() -> void:
for _knowledge in Save.gameStats.KnowledgeListRef:
var newKnowledgeUI : KnowledgeInstancePanel = knowledgeUIRef.instantiate()
the "instantiate()" part prompts me to and executes the "ready" function which ideally would be the init or something else?