Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
1
Question by PaxForce · Jan 07, 2017 at 11:03 AM · assetbundleassetsresourcesresources.load

What use instead of Resources folder?

The following code allows me to simply add new audio files to my resources folder and rebuild - I don't have to change the code or "drag and drop" files in the inspector (that I especially hate).

 public AudioClip[] playlist;

 private void Awake()
   {
     playlist = Resources.LoadAll("Music/MusicForrest") as AudioClip[];
   }

I've been utilizing loading stuff from Resources folder (audio files, textures, etc.) for some time. But now I'm reading the Best Practices for the Resources System page about Resources folder and the first advice from Unity guys is: "Don't use it."

The question is what should I use as an alternative to Resources folder while retaining the simplicity of adding new stuff (adio files, textures, etc.) to the game?

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Owen-Reynolds · Jan 07, 2017 at 03:01 PM 0
Share

The Resource folder has special auto-load rules in Unity builds. Read the page which explains the rare times you need that folder - it also explains the normal way, which is to use any other folder (the last line of tashimo's answer, in more detail.)

3 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by ModLunar · Aug 24, 2017 at 08:17 PM

I was wondering exactly the same thing! I heard some things about making AssetBundles and being able to load lots of assets using those. From what I heard, AssetBundles are recommended by Unity for us to use, though I have little experience with them.

I also was thinking, if using AssetBundles doesn't do it (or perhaps you don't want to for some reason) maybe an editor script could set the references for you in the inspector if you have your assets organized under a folder? I'm kind of just thinking off the top of my head, but I hope some of this thinking out loud helps!

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by tanoshimi · Jan 07, 2017 at 11:18 AM

From the page you linked: "Resources is an excellent system during rapid prototyping and experimentation because it is simple and easy to use. However, when a project moves into full production, it is strongly recommended to eliminate uses of the Resources folder."

So if you're changing your music files a lot during development, that's fine to continue to use. But when your assets become fixed and you move into production, you should create instance references to them in an audiomanager object, say.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image PaxForce · Jan 07, 2017 at 11:25 AM 0
Share

tanoshimi I know what the page reads, because I read it all. I want to avoid "dragging and dropping" stuff in inspector. That is why I asked my question in my post: what should I use as an alternative to Resources folder.

avatar image tanoshimi PaxForce · Jan 07, 2017 at 11:53 AM 0
Share

The alternative to loading assets from the Resources folder is to create references in the inspector. That's how Unity works.

avatar image
0

Answer by tinglers · Mar 04, 2017 at 03:45 PM

maybe this is what you are looking for? https://unity3d.com/learn/tutorials/topics/scripting/assetbundles-and-assetbundle-manager

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

68 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

how to load texture from C:\ Folder at Runtime build 2 Answers

asset quality suddenly very low? 0 Answers

Warning:Trying to move asset to location it came from...[Please Help] 0 Answers

Asset Bundle vs Resources vs ?? 1 Answer

How does Addressable assets load from local works specialy for webgl? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges