Hi,
I use assetbundles to load dynamically the levels of my game. It used to work for weeks, but now suddenly and without any apparent reason, ALL the gameobjects behaviour cannot reference the own scripts anymore!
This happens only if I test the game in the Editor, while in the web player everything works fine.
Unity version 3.5.1
Submit this report using Unity’s bug reporter.
I cannot, the project is too big and cannot under publisher contract. If I make a specific project for debugging purposes it is very likely the project will not show up, since it is not very easy to reproduce (the most closest thing to say it is that it is not deterministic, although it obviously does not make sense).
I try to copy and paste some code:
BuildPipeline.PushAssetDependencies();
BuildItemBundles (); //shared props, they are prefabs, can contain references to monobehaviours
BuildPipeline.PushAssetDependencies();
BuildSharedAtlasBundles (); //shared GUI textures
BuildPipeline.PushAssetDependencies();
BuildLevelBundles (); //build an asset bundle for each level
BuildPipeline.PopAssetDependencies();
BuildPipeline.PopAssetDependencies();
BuildPipeline.PopAssetDependencies();
Normal asset bundles are built with these settings:
BuildPipeline.BuildAssetBundle(objectToBuild, null, prefab, BuildAssetBundleOptions.CollectDependencies|BuildAssetBundleOptions.CompleteAssets|BuildAssetBundleOptions.DeterministicAssetBundle, BuildTarget.WebPlayer);
For the scene asset bundles:
BuildPipeline.BuildStreamedSceneAssetBundle(new string[ ] {level}, prefab, BuildTarget.WebPlayer);
Unluckily the results change every time (without changing settings), After the build sometime happens:
- Everything works OR
- The game in the editor cannot reference the monobehavior used in the gameobjects loaded from the AssetBundles anymore OR
- The game in the editor works, but the web player version cannot reference the monobehaviour used in the gameobjects loaded from the AssetBundles anymore
Please tell me there is something you can do about it…all this stuff is quite scary.
P.S.: when I build the web player version now I get srcFileInfo.temporaryObjectIdentifier.localIdentifierInFile == localIdentifierInFile
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()
I am alone and desperate in this valley of tears
I just rebuilt the assetbundles with BuildTarget.WebPlayerStreamed and not it works, it is totally random
I met the same problem as yours, have you solve it? help me if you get a solution.I am also desperate
Same problem here, anyone fixed it?
I had a bug in my build code where I was missing a PopAssetDependencies. This caused all future asset bundle builds to be weird (have things stripped from them) until I rebooted Unity.