Last Topic: 5:36:31pm, 09/23/2023
Last Post: 12:30:20am, 10/07/2023
I use plain Nodes as containers a lot too for grouping something of a particular type so I can go like this
-------
generally have a lot of exports for node references and configs
[ExportGroup("Config")]
[Export]
YamlResource _recipeYaml;
Recipe _recipe;
[ExportGroup("References")]
[Export]
Node _equipmentContainer;
Array<Equipment> _equipment = new Array<Equipment>();
------
then on ready do this
public override void _Ready()
{
CacheComponents();
Setup();
ConnectSignals();
}
void CacheComponents()
{
foreach (var child in _equipmentContainer.GetChildren())
{
_equipment.Add((Equipment)child);
}
_recipe = _recipeYaml.Deserialize<Recipe>();
}
-----
apparently spacing doesn't work well even with the code formatting..
---
kriem