Home > Net >  When is it better to use Resources.Load in Unity?
When is it better to use Resources.Load in Unity?

Time:02-04

Hello everyone I recently learned how to use Resources.Load, but I have a question, when should I use it?

For example, I have a button that has 2 different sprites. What is the best way to do, load these two sprites in advance in the editor and turn one on and off the other? Or at the Start, load it Resources.Load<Sprite> and replace the sprite in the Source Image? Please explain when and how best to use Resources.Load. Examples will be useful

CodePudding user response:

Resources.Load is useful for loading prefabs common to many scenes. And for editor scripts.

Nevertheless, the devs will be deprecating Resources.Load at one point, but backed off from it, because there are good reasons to keep it around until/if they replace it with something better.

CodePudding user response:

If you have some Resource not use it at all time. you can use Resources.Load when you use before. it's about your memory.

  • Related