Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
avatar image
1
Question by fisyher84 · Feb 28, 2012 at 07:10 AM · assetbundleloading

Why is there no such thing as a LoadAllAsync method?

I want to be able to load all assets in my AssetBundle asynchronously without storing their IDs externally. I have read that LoadAll method does this very nicely but I want to be able to perform the loading asynchronously.

I was surprised to see that there is no such method as LoadAllAsync. The only method that loads assets asynchronously is the LoadAsync method which takes in a name, implying that I have to know the names of the assets I want to load beforehand. Is there any reason why a LoadAllAsync method does not exist?

Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
-2

Answer by Paulius-Liekis · Feb 28, 2012 at 11:50 AM

How are you going to access assets without knowing the names?

As Unity documentation says that one of the tricks is creating a TextAsset in the asset bundle which contains names of all assets.

Comment
Add comment · Show 4 · 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 fisyher84 · Feb 29, 2012 at 06:11 AM 0
Share

And with that you would still need to know the name of that one TextAsset right? Anyway, I was just trying to change all my load assets functions to be asynchronous as I thought loadAll will take a long time for a huge asset bundle but it turns out not so (at least for my use case). I was using the WWW class to download the asset bundle file from a local drive and turns out it is the WWW class that blocks and needs to be yielded as shown in the Unity WWW class reference sample code. If that is the case, what would be the use case of loadAsync method since the time-consu$$anonymous$$g import is already done by the WWW class?

avatar image Paulius-Liekis · Feb 29, 2012 at 09:02 AM 0
Share

Yes, loading it from disk is the slower part, but depending on how many assets and what kind you have in your asset bundle instantiating them can take significant amount of time.

avatar image Fattie · Jan 24, 2016 at 05:26 PM 0
Share

This is nonsensical, Paulius.

Of course, it would be exactly the same as when you use LoadAll ...

you just use .name This is absolutely standard. There'd be no difference at all if they were loading async.

 rawArrayOfClips = 
  Resources.LoadAll("VO/", typeof(AudioClip) ).Cast<AudioClip>().ToArray();
 int kRA = rawArrayOfClips.Length;
 for(int index=0; index<kRA; ++index)
   {
   Debug.Log(rawArrayOfClips[index])

it is

staggeringly silly

Unity did not throw in LoadAllAsync. Bad Unity.

avatar image Fattie · Jan 24, 2016 at 05:27 PM 0
Share

Fisyher, you're right that the www class is sort of like an async loader -- pity it hardly works. (Google)

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

6 People are following this question.

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

Related Questions

A node in a childnode? 1 Answer

3.5.7 Importing assets from asset store - kMetaAssetType 0 Answers

Assetbundle loading time 0 Answers

Asset bundle downloads lagging after upgrading project from Unity 2018.X to Unity 2019.X 0 Answers

Link between two script in two different folders 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