I am trying to build an asset bundle with a Scene and all the assets that scene needs in a single assetbundle but I am getting an error that says:
Cannot mark assets and scenes in one AssetBundle. AssetBundle name is “game0bundle”.
But in the Unity tutorial on AssetBundles And The Assetbundle Manager says things like “AssetBundle is a collection of assets and/or scenes” which makes it sound like you can put both assets and scenes in the same assetbundle. So am I suppose to be able to put scenes and assets in the same bundle and I’m doing something wrong or is the tutorial just worded strangely?
Having worked with AssetBundles, I can tell you it is good practice to keep your assets that scenes and prefabs are dependent on separate from scenes and prefabs.
If you explicitly mark all of your materials, textures, and meshes into an assetbundle (or multiple assetbundles), then the assetbundles that contain your scene and prefab info will be very small (because they are referencing them instead of making copies).
It would be nice if Unity had a system of stepping through your hierarchy and labeling assets as being dependent on a specific scene, though you will run into the trouble of each asset only being able to be marked as belonging to 1 AssetBundle in the inspector.
We can put both assets and scenes in bundle. But we should put them in separate bundles.
It means puting assets in a bundle and puting scenes in another bundle. Bundle is not a mixture with assets and scenes.