Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 11 Next capture
2021 2022 2023
1 capture
11 Jun 22 - 11 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 Peter Suwara · Jul 28, 2015 at 12:21 PM · bug-perhapsassetbundlesunloadloadfromcacheordownloadunloadunusedassets

[AssetBundles] - Why is my assetbundle.unload not unloading assets and therefore cannot loadfromcacheordownload again ?

Hi all,

I am looking for some urgent advice/help regarding asset bundle LoadFromCacheOrDownload. UnloadAssetBundle is called on a button click in the UI. loadedAssetBundle is a member variable of class that has the functions.

The following are the steps I take :

  1. LoadFromCacheOrDownload(URL, 0) <- Get a WWW download with assetbundle from the web.

  2. The above is successfull the first time. I check the IsVersionCached -> Returns TRUE.

  3. Call Unload(false) on the asset bundle then destroy the object.

  4. Try LoadFromCacheOrDownload(URL, 0) again with the same asset bundle.

  5. Get the error -> Cannot load cached AssetBundle. A file of the same name is already loaded from another AssetBundle.

See code below :

 private AssetBundle loadedAssetBundle;
 public IEnumerator DownloadAtURL(string assetName, string URL)
     {
 
         Debug.Log("PRE ASSET CACHED = " + Caching.IsVersionCached(assetName, 0));
         Debug.Log("Downloading using -> WWW.LoadFromCacheOrDownLoad");
 
         var www = WWW.LoadFromCacheOrDownload(URL, 0);
         yield return www;
         if(!string.IsNullOrEmpty(www.error))
         {
             Debug.Log(www.error);
             yield return null;
         }
   
         Debug.Log("Finished downloading assetbundle");
         Debug.Log("POST ASSET CACHED = " + Caching.IsVersionCached(assetName, 0));
 
         loadedAssetBundle = www.assetBundle;
     }
 
     public void LoadAssetBundle()
     {
         Debug.Log("Loading all assets for bundle " + loadedAssetBundle.name);
         loadedAssetBundle.LoadAllAssets();
     }
 
     public void UnloadAssetBundle()
     {
         Debug.Log("Unloading asset bundle " + loadedAssetBundle.name);
         loadedAssetBundle.Unload(true);
         Destroy(loadedAssetBundle);
     }

See output below :

 Download Asset
 
 POST : https://55AE.playfabapi.com/Client/GetContentDownloadUrl
 
 Get content download URL for asset : 1/Windows/Windows result : https://cdn.playfab.com/55ae/etc/1/Windows/Windows?Expires=1438065963&Signature=oJa3DBfiDyRyE2hHix~Wpm1VqLrfoBzLTvlbTlf2RjPGtcwVAJj1y6ms9gp102GLAd7FAT2d-VCpSFKRAXLUPD04tor4j7znLl7EWQqi6TgEyBeLwBp3XY8D69S8gD4EJFH3V54hUVNZmk0nRCKBp4pJqnph4y4-DcChuCiIx0U_&Key-Pair-Id=APKAIOVJ4VBNZZU4TTQA
 
 Downloading 1/Windows/Windows from https://cdn.playfab.com/55ae/etc/1/Windows/Windows?Expires=1438065963&Signature=oJa3DBfiDyRyE2hHix~Wpm1VqLrfoBzLTvlbTlf2RjPGtcwVAJj1y6ms9gp102GLAd7FAT2d-VCpSFKRAXLUPD04tor4j7znLl7EWQqi6TgEyBeLwBp3XY8D69S8gD4EJFH3V54hUVNZmk0nRCKBp4pJqnph4y4-DcChuCiIx0U_&Key-Pair-Id=APKAIOVJ4VBNZZU4TTQA
 
 PRE ASSET CACHED = False
 Downloading using -> WWW.LoadFromCacheOrDownLoad
 starting www download: https://cdn.playfab.com/55ae/etc/1/Windows/Windows?Expires=1438065963&Signature=oJa3DBfiDyRyE2hHix~Wpm1VqLrfoBzLTvlbTlf2RjPGtcwVAJj1y6ms9gp102GLAd7FAT2d-VCpSFKRAXLUPD04tor4j7znLl7EWQqi6TgEyBeLwBp3XY8D69S8gD4EJFH3V54hUVNZmk0nRCKBp4pJqnph4y4-DcChuCiIx0U_&Key-Pair-Id=APKAIOVJ4VBNZZU4TTQA
 https://cdn.playfab.com/55ae/etc/1/Windows/Windows?Expires=1438065963&Signature=oJa3DBfiDyRyE2hHix~Wpm1VqLrfoBzLTvlbTlf2RjPGtcwVAJj1y6ms9gp102GLAd7FAT2d-VCpSFKRAXLUPD04tor4j7znLl7EWQqi6TgEyBeLwBp3XY8D69S8gD4EJFH3V54hUVNZmk0nRCKBp4pJqnph4y4-DcChuCiIx0U_&Key-Pair-Id=APKAIOVJ4VBNZZU4TTQA cached to C:/Users/Peter/AppData/LocalLow/Unity/WebPlayer/Cache/InfinityPlusTwo_puzzleverse/26d9c28d789c254f71ea99a3463b99a7ccc2f4fa
 ----- Total AssetImport time: 0.065631s, AssetImport time: 0.000000s, Asset hashing: 0.000000s [0 B, 0.000000 mb/s]
 
 loading from cache: https://cdn.playfab.com/55ae/etc/1/Windows/Windows?Expires=1438065963&Signature=oJa3DBfiDyRyE2hHix~Wpm1VqLrfoBzLTvlbTlf2RjPGtcwVAJj1y6ms9gp102GLAd7FAT2d-VCpSFKRAXLUPD04tor4j7znLl7EWQqi6TgEyBeLwBp3XY8D69S8gD4EJFH3V54hUVNZmk0nRCKBp4pJqnph4y4-DcChuCiIx0U_&Key-Pair-Id=APKAIOVJ4VBNZZU4TTQA
 Finished downloading assetbundle
 POST ASSET CACHED = True
 Unloading asset bundle
 
 Download Asset
 
 POST : https://55AE.playfabapi.com/Client/GetContentDownloadUrl
 
 Get content download URL for asset : 1/Windows/Windows result : https://cdn.playfab.com/55ae/etc/1/Windows/Windows?Expires=1438065979&Signature=eLuGatsAj0-yGDjltOWYIQjBf~4oNtGFlvOcXhacjt0InZjLotfyWPAHAWW64j3UH06sTYfeC9OGmmOjTD~WkkYSLgu5qpLtad6e~DF-cYj3jiK~fblZMEKsTAqhlb3m8~ZnaHqfsFS9~PGjoipUTNHvMy0Yh0JKYwwpa~N3B0Y_&Key-Pair-Id=APKAIOVJ4VBNZZU4TTQA
 
 Downloading 1/Windows/Windows from https://cdn.playfab.com/55ae/etc/1/Windows/Windows?Expires=1438065979&Signature=eLuGatsAj0-yGDjltOWYIQjBf~4oNtGFlvOcXhacjt0InZjLotfyWPAHAWW64j3UH06sTYfeC9OGmmOjTD~WkkYSLgu5qpLtad6e~DF-cYj3jiK~fblZMEKsTAqhlb3m8~ZnaHqfsFS9~PGjoipUTNHvMy0Yh0JKYwwpa~N3B0Y_&Key-Pair-Id=APKAIOVJ4VBNZZU4TTQA
 PRE ASSET CACHED = True
 Downloading using -> WWW.LoadFromCacheOrDownLoad
 
 You are trying to load data from a www stream which had the following error when downloading.
 Cannot load cached AssetBundle. A file of the same name is already loaded from another AssetBundle.
 UnityEngine.WWW:get_assetBundle()
 
 [C:/buildslave/unity/build/Runtime/Misc/WWWCached.cpp line 265]
 (Filename: Assets/sdk/scripts/TestBedController_Dev.cs Line: 357)
 
 WWWCached data can only be accessed using the assetBundle property!
 WWWCached data can only be accessed using the assetBundle property!
 WWWCached data can only be accessed using the assetBundle property!
 WWWCached data can only be accessed using the assetBundle property!
 You are trying to load data from a www stream which had the following error when downloading.
 
 Cannot load cached AssetBundle. A file of the same name is already loaded from another AssetBundle.
 WWWCached data can only be accessed using the assetBundle property!
 WWWCached data can only be accessed using the assetBundle property!
 WWWCached data can only be accessed using the assetBundle property!
 
 Cannot load cached AssetBundle. A file of the same name is already loaded from another AssetBundle.
 
 Finished downloading assetbundle
 
 POST ASSET CACHED = True
 You are trying to load data from a www stream which had the following error when downloading.
 Cannot load cached AssetBundle. A file of the same name is already loaded from another AssetBundle.

Any ideas why UNLOAD is not working ?! Seems like a bug in unity, not sure what else I can do here. Would be most appreciated and thanks in advance.

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

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

2 People are following this question.

avatar image avatar image

Related Questions

UnloadUnusedAssets 1 Answer

Asset bundle resources becoming null. 1 Answer

Static mesh smooth, safe Unload ? 2018.1 2 Answers

Asset bundles caching.IsversionCached() always returns false 1 Answer

Max Size of Textures from AssetBundle 1 Answer


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