- Home /
What does Unity actually do when Loading Resources that already exist?
https://www.indiedb.com/games/historica-fantasia/news/unit-mesh-generation-system
Here's how my System work at the moment.
=> Load a Unit Prefab from a Resource Folder. => Cache the Object to an Object Pool. If the Pool doesn't exist, create one. => When a new Unit that use the same Prefab got generated, the Prefab in the Pool will be duplicated instead of doing Resources.Load() again
I designed this to optimized Loading Process.
However, the question that I would like to ask is, what would happened if I did Resources.Load() on a Prefab that already got loaded?
Will it point to an Object that already exist in the scene? Or will it completely do a new loading process again?
In my Game Design Scenario, 10 of the same Prefab could be generated at the start of the Game. But they'll get newly generated or destroyed on a rare occasions. So, Object Pooling doesn't really give that leap of a benefit compare to the risk of facing bugs due to complication in the Program.
If Resources.Load() will point toward an Object that already got loaded, I might consider simplifying things down.
THX in advance.
Afaik, anything that gets "loaded" through Resources.Load just gives you a version of it in runtime memory.
10 calls, 10 copies etc.