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
0
Question by Kevin-Phunware · Oct 11, 2017 at 06:11 PM · assetsassetbundlesasset bundlesunloadingunloadunusedassets

Are My AssetBundles Being Unloaded On Me Without My Doing So?

I have a very strange issue I'm hoping someone could shed some light on (mobile app)... at least offer somewhere to look. I have 6 AssetBundles in my game that are getting loaded at startup. I create an assetDictionary of name-references for all the objects in my AB's. Then, when I need one of those assets, I'm use the dictionary to point to the correct AB from which I attempt to LoadAsset. However, in my "new install flow", when I attempt to LoadAsset from an AssetBundle, it returns null. If I run once more (now not through my "new install flow" - some user profile data has been stored on disk), those same LoadAsset calls which returned null now return their valid objects.

Obviously, I could simply have some mysterious problem in my code, but I believe this started happening when I went from 5 AB's totaling 15MB in size to 6 AB's totaling 27MB. I also read in some of the documentation that once we're out of caching space, the least recently used AB will be unloaded.

So, I'd love to find a way to see a log or event when the AB gets unloaded on me, if this is happening; or at least have some way of knowing the status of my AssetBundle... viewing its object in the debugger at runtime offers zero insight into the availability of its contents.

Any assistance here would be much appreciated.

Thanks.

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 Kevin-Phunware · Oct 12, 2017 at 08:41 PM 0
Share

So, I tracked down in my code what action was causing the AssetBundles to return null. I have in my logic, many of these ScriptableObjects being created at runtime (AssetDatabase.CreateAsset). Obviously, this only happens in Editor, and when I call this at a time when the asset to be created already exists (again, this is at runtime), appropriately, the CreateAsset API first deletes the existing asset and proceeds to create a new one. However, the loss of this asset then somehow invalidates all of my AssetBundles...

In other words, doing CreateAsset on an asset that already exists at runtime within the Editor causes loaded AssetBundles to be invalidated.

0 Replies

· Add your reply
  • Sort: 

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

118 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 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 create a Assetbundle of low size 1 Answer

Addressables build failing due to Lua scripts and then for an unknown reason 0 Answers

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

Why does the AssetBundle needs the assets to be present in the folder? 0 Answers

Script for unloading assets and textures? 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