I have a gameobject that’s used to instantiate prefabs. The prefabs this gameobject instantiates are referenced via serialized fields. The gameobjects to instantiate use textures.
Does Unity readily load into memory these assets the gameobjects use even if the gameobjects have not been instantiated yet (they are just referenced)?
I’m having memory usage issues now. T.T
Yes they are loaded into memory.
In one of our project we had to write a special container to prevent this.
The basic idea is to put all assets in Resources folder. Then instead of referencing directly the prefab, you use the path (stored as a string). When you need to instantiate it, first use Resources.Load using the path.
Additionally, we had a custom inspector to help the designer set reference as usual (by drag and drop) and let the container store the path instead.