- Home /
Is Resource.Load() check if the object is already in the memory?
Long story short, I have a huge amount of custimazable objects in my game, so for saving memory I'm not loading everything when it's not needed, only when I want to spawn stuff. Is it okay to use Resource.Load every time I want to spawn a specific item? I mean Unity check if it's already in the memory, or do I have to do it myself?
I don't really understand the whole concept behind it, right now I'm dragging the desired prefab into a variable in the inspector, I can get it's information(like it's name), but I can only spawn it if there is already one instance of it in the scene, or by using Resource.Load() - otherwise I get the "prefab is null" error. Why can Unity get it's info but the object?
Comment