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 jasonFHH · May 27, 2012 at 11:21 PM · iosscenecrashdynamicasset bundle

Why am I losing all scene data when loading an Asset Bundle-loaded scene?

I'm working a Unity iOS pro project where we make use of asset bundles. I dynamically download the asset bundle which defines an entire scene. I currently use the following procedures to load in an asset bundled scene which seemed to work in Unity 3.5.1, but doesn't work for me anymore (I get a completely empty scene) after I upgraded to Unity 3.5.2:

     public IEnumerator DownloadLevelBundle(int levelId, int versionNumber = 1)
     {
         WWW download;
        
         string downloadUrl = ...; //omitted
         Debug.Log("About to download " + downloadUrl + " ...");
         //download = new WWW (downloadUrl);
         download = WWW.LoadFromCacheOrDownload (downloadUrl, versionNumber);
        
        
         yield return download;
        
         if(download.error != null)
         {
             Debug.Log(download.error);
             return false;
         }
        
         Debug.Log("Level downloaded");
        
         AssetBundle assetBundle = download.assetBundle;
        
         if (assetBundle != null)
         {
             Application.LoadLevel("main"); // the scene file is called 'main'
             Debug.Log("Waiting for end of frame...");
             yield return new WaitForEndOfFrame();
         Debug.Log("Frame ended");
             assetBundle.Unload(false); // only free the scene after the frame has ended
         }
         else
             Debug.Log("Couldnt load resource");
     }

When I had previously encountered this issue, I figured it was due to the fact that Application.LoadLevel defers loading the objects until the next frame, hence I added in the frame yield. This no longer does the trick though.

Oddly enough, if I do TWO next frame yields, all my scene data appears, but the entire Unity IDE crashes when I stop playing.

Any ideas of what I need to do to a) get the scene to appear, and b) not have Unity IDE crash when I stop playing the scene?

Thanks in advance, Jason

Comment
Add comment · Show 3
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 jasonFHH · May 29, 2012 at 08:14 PM 0
Share

anyone have any light to shed on this?

avatar image ahsoka · Jun 05, 2013 at 04:50 PM 0
Share

Did you resolve this problem? Could you help me? I have the same problem. $$anonymous$$y Unity IDE crashes when I stop playing but my scene data never appear. Thanks.

avatar image JoaquinRD · Aug 28, 2013 at 06:12 PM 0
Share

I have this problem even without unloading any assets at all. After loading a scene from an asset bundle, Unity crashes when I stop playing.

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

6 People are following this question.

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

Related Questions

How can I stop my editor from crashing everytime it loads a new Scene during runtime? (since Unity 4) 2 Answers

Crash with iOS Build 2 Answers

Webplayer hangs on loading scene 2 Answers

ArgumentOutOfRangeException when calling CrashReport.reports 0 Answers

EXC_BAD_ACCESS when rotating the device in iOS simulator 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