I’ve been using the old-fashioned BuildPipeline.BuildAssetBundle function to create Asset Bundles for my project for quite some time, but it’s now time to move on to the new system, as I can’t get bundles made this way to work in UWP on ARM64.
Each bundle contains a single prefab that I want to instantiate.
The trouble is that after I add my prefab to the bundle and build them all, my new bundles don’t include all of the materials, textures or meshes that they need - according to the manifest, the resulting bundles only include the .prefab file itself.
When I try to instantiate the prefab, I get the correct structure, but all of the meshes, materials, textures, animations etc. are missing.
Even more annoying, if I use the Unity ‘Find Dependents’ feature (which does correctly identify the assets I need) and manually add them to the prefab, they still don’t work, even though the manifest and bundle file-size indicate that they’ve been included.
Has anyone seen this sort of behaviour before and know how to fix it? I want something that works like the old BuildAssetBundleOptions.CollectDependencies option used to.
,I’ve previously used the old-fashioned BuildPipeline.BuildAssetBundle function to create bundles containing prefabs, and they’ve always included all of the resources they need.
However, it seems I’m finally being forced to upgrade to the new Asset Bundle system to try and get bundles working in UWP for Hololens, and so far it doesn’t seem to be working at all.
If I add my prefab to a new bundle and build it, I get a bundle with only that prefab - no meshes, no textures. The manifest agrees - no dependencies and just the .prefab file.
When I load the prefab using Bundle.LoadAllAssets(), Bundle.LoadAsset() or Bundle.LoadAssetWithSubAssets(), I get the right //structure//, but all of the meshes, animations and materials are empty and a whole bunch of WARNING: Object with NULL Material Slot errors.
Even if I use ‘Show Dependencies’ in Unity and manually add the mesh, textures and materials to the AssetBundle, those meshes, animations and materials are completely empty, even though the manifest file and the size of the bundle itself let me know they have been included.
Does anyone have any idea why this is failing, and how I can get by prefabs working?