Hi everyone, I have a ScriptableObject that holds references to prefabs placed in the folder Assets/MyCustomPrefabs Reference of this ScriptableObject is used by the LevelLoader Monobehavior script which uses it to get the prefab references and instantiate the object. My question.. is this the right approach to do so? And does this works fine in PC and mobile builds? Thank you
Yes and no. It works, but it causes all of those prefabs to always be referenced. This means that they'll never be unloaded, so they'll be taking up space in memory even when not in use. Unless you're running out of memory, that probably won't be a problem.
Memory is not going to be an issue so it would be totally fine having the prefabs in the memory. Is it also ok to load the prefabs from resources whenever needed and then just unload after instantiating? In my case it's only needed once when I am making the object pool and also when the pool runs out of objects