- Home /
Resources.Load() What has to be in Resources Folder
Hey guys! :)
I am wondering if I want to Load something from Resources on Runtime like a Prefab, does the Texture that is assigned to the prefab also have to be in the Resources Folder?
Thank you! :)
Answer by lunoland · Aug 17, 2016 at 08:08 PM
Only the prefab needs to be in the folder. You can also load any type of asset (Sprite, AnimationClip, whatever) in addition to prefabs (which are of the type GameObject).
For this reason, you may as well put all of your non-script assets inside the Resources folder so you can load them as needed. Note that you can organize your Resources folder however you like with sub directories.
// To load a sprite called "PlayerSprite" in /Resources/Sprites
Sprite mySprite = Resources.Load<Sprite>("Sprites/PlayerSprite");
Your answer
Follow this Question
Related Questions
What does Unity actually do when Loading Resources that already exist? 0 Answers
Resources not loading in APK 0 Answers
Distribute terrain in zones 3 Answers
Convert XML Deserializer from folder to resources 2 Answers
Resources.Load() or Prefab manager? 1 Answer