I need to have references to various types of prefabs so as to instantiate them and build a level at runtime.
When the scene starts, I read a JSON file and decide what prefabs I will need to instantiate. Say there are 70 prefabs in total, but for a level I may only need 20 of them.
One approach would be to have a script referencing all 70 prefabs (drag and drop through the editor, the first problem). As far as I understand, that will be a big waste of memory (as all prefabs will be loaded into memory and I will only use a few).
The other approach would be loading prefabs via Resources.Load() at runtime, and catch them into a reference variable so as to instantiate them after. That way I’ll be able to load only the prefabs I’m interested in.
I see the first option bad for memory (I’m developing a mobile game), and the Unity Documentation makes it clear to stay away from Resources.Load(). Would this be a “good” scenario for using Resources.Load() or should I explore some different approach?