- Home /
 
               Question by 
               Catlard · Nov 19, 2013 at 08:25 AM · 
                nullassetbundlesunloadunloading  
              
 
              Asset bundle resources becoming null.
So...whenever I load this assetbundle and store the asset in a gameobject, and then try to refer to it, it exists -- but one frame later it's turned null, and doesn't exist in the list I've stored it in, either. I've tried using Unload(false) on the asset bundle -- this will STOP unity from unloading the bundle's in-scene data, right? But it doesn't change anything. Really what I want is to load the bundle, place the bundle's contents in a list, and then unload the bundle. What am I doing wrong?
 IEnumerator Start () {
         yield return BundleUtils.instance.StartCoroutine("LoadBundle", new BundleArgs(1, _testURL));
         ab = BundleUtils.instance.GetLoadedBundle();
         GameObject abGo = ab.Load("BearMovie") as GameObject;
         //can instantiate here, or print the name of abgo, but it's null after here!
         _menu._items.Insert(0, new BenchmarkItem(BenchmarkMenuAction.AddPrefab, abGo));
 
     }
               Comment
              
 
               
               
               Best Answer 
              
 
              Answer by Catlard · Nov 19, 2013 at 09:09 AM
This was a bug in another script. Case closed. This code works fine, actually. Sorry!
Your answer
 
 
              koobas.hobune.stream
koobas.hobune.stream 
                       
                
                       
			     
			 
                