Resources or lists, one is lighter?

Hello,

At several moments, in my game, many GameObjects (Images) change sprites from the Update. This sometimes causes the game to lag.
I would like to know if it was lighter to call these sprites from Resources (Using Resources.Load(path).sprite) or from pre-filled Sprite lists. Or if it made no difference.

Directly referencing them means they’re already loaded into memory. Resources will be loading them in on the fly. Needless to say the former will always be faster than the latter.

Nonetheless, if you have performance issues, profile them, and work out where the actual issue is before you go trying to solve it.

Thanks, what you say about “on the fly” is also valid for a built game?

Yes it works the same in the editor as it does in a build.

i dont think loading from resources will help you, using resources is to save memory, in other words ram, you can easily check your task manager and see if your game is taking abusive ram, like 4gb

what is lagging your game is probably a cpu action, and resources wont help you fix that