Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | ronn1067 |
I have at problem with Labels not Updating after its properties is set… If I add the Inventory-Instance to world Before loading new data in, then I have no problem… but if I add the Instance after new data is set… It will only show my old and first data? Am I using AddChild wrong or is it an Engine bug??
Note: this is a test scene, and in my big project, I have to add the Instance after loading new data.
Note : If I add the Instance to the world, remove it, set new data, and then adding it to world again … then i works too?
//This is the buggy code
inventory = new Inventory<Item>(20);
inventory.Add(JsonItemLoader.ItemCreator<Item_Material>.CreateItem('F', "Lumber", AllLibraries.material_Library.AllMaterials) as Item, 20);
inventory.Add(JsonItemLoader.ItemCreator<Item_Material>.CreateItem('F', "Lumber", AllLibraries.material_Library.AllMaterials) as Item, 40);
inventory.Add(JsonItemLoader.ItemCreator<Item_Material>.CreateItem('F', "ScrapBar", AllLibraries.material_Library.AllMaterials) as Item, 40);
inventory.Add(JsonItemLoader.ItemCreator<Item_Material>.CreateItem('F', "ScrapBar", AllLibraries.material_Library.AllMaterials) as Item, 40);
inventory.Add(JsonItemLoader.ItemCreator<Item_Material>.CreateItem('F', "Scrap", AllLibraries.material_Library.AllMaterials) as Item, 65);
inventory.Add(JsonItemLoader.ItemCreator<Item_Material>.CreateItem('F', "Scrap", AllLibraries.material_Library.AllMaterials) as Item, 65);
inventory.Add(JsonItemLoader.ItemCreator<Item_Material>.CreateItem('F', "Scrap", AllLibraries.material_Library.AllMaterials) as Item, 65);
inventory.Add(JsonItemLoader.ItemCreator<Item_Material>.CreateItem('F', "Scrap", AllLibraries.material_Library.AllMaterials) as Item, 65);
inventory.Add(JsonItemLoader.ItemCreator<Item_Material>.CreateItem('F', "Scrap", AllLibraries.material_Library.AllMaterials) as Item, 88);
AddChild(inventory.Instance);