Hi. I was profiling the memory consumption of my game and realized that every inventory item's icon was always loaded in memory. Even if the item would not be granted to the player until much later in a different scene. Is that an AC setting that I can toggle? Or how can I prevent that? I'm using AC 1.74.2 and Unity 2022.3.39f1
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
As of v1.76.1, AC makes it possible to use scripting to override an item's texture at runtime via its ItemInstance. One approach would be to leave the icons fields empty, and then assign them separately at runtime via e.g. Resources:
In earlier releases, you can still use scripting to affect the original items - but you'll have to affect the Inventory Manager asset itself, which will need resetting once you exit the game so as to avoid persistent changes.
The main challenge is to set the textures at the correct time. You could try to do so at the point of addition (i.e. via the OnInventoryAdd custom event), but - at least to begin with - a brute-force approach would be to check the textures of carried items in an Update loop, i.e.: