Unity-Technologies / AssetBundles-Browser

Editor tool for viewing and debugging asset bundle contents before and after builds
Other
2.2k stars 528 forks source link

How to resolve is auto included in multiple bundles #120

Open MuhammadFaizanKhan opened 5 years ago

MuhammadFaizanKhan commented 5 years ago

This is not an issue but i am searching for a proper way to do this job. I am getting warning that some of the assets (like materials texture), like etc texture auto included in multiple bundles. How do i resolve it? I found that i can move it to new bundle. Okay i will do this, but how do i will load it? do i need to load it explicitly ? or unity will get it automatically? How i will know that this asset is depending to some other bundle and load that bundle first?

alffanclub commented 5 years ago

If you have a prefab in BundleA and it references a texture that's in BundleB, you have to load both bundles, then load the prefab. How do you know that the prefab needs these two bundles? The info you need should be in the manifest, but this is a complex process. The complexity involved in managing bundles at runtime is one of the main motivators for us creating the Addressables system. If you are early in a project, and unfamiliar with how to deal with bundles, I strongly recommend moving to that.
https://docs.unity3d.com/Packages/com.unity.addressables@0.6/manual/index.html

MuhammadFaizanKhan commented 5 years ago

If you have a prefab in BundleA and it references a texture that's in BundleB, you have to load both bundles, then load the prefab. How do you know that the prefab needs these two bundles? The info you need should be in the manifest, but this is a complex process. The complexity involved in managing bundles at runtime is one of the main motivators for us creating the Addressables system. If you are early in a project, and unfamiliar with how to deal with bundles, I strongly recommend moving to that. https://docs.unity3d.com/Packages/com.unity.addressables@0.6/manual/index.html

So you mean that first i have to manually load the dependency bundle and wait until its fully load. Then i should load the other bundle and instantiate its object.

alffanclub commented 5 years ago

Order does not matter, but you do need both bundles to finish loading. Of note, loading an AssetBundle does not load it's contents. It loads the asset bundle header. So once the bundle is on-device, loading the bundle itself is very fast. Loading it's contents can be slow.

PabloMonfort commented 3 years ago

im having an issue with assets bundle browser, it doesn't let me remove textures and materials from an assets bundle that's containing a prefab that use a fbx , this fbx if I set the materials to none its just not doing what I want and its still including Auto those textures and materials that's seems to come from the fbx itself? but I set it to none in the material inspector part so I'm confuse why they are not refreshing and putting them out of the asset bundle :( coz I want to handle this in other way using atlasing and I don't need those extra textures loading on memory for just nothing.

PabloMonfort commented 3 years ago

i get this error when i try to remove those assets that I don't want in the build :S

NullReferenceException: Object reference not set to an instance of an object AssetBundleBrowser.AssetBundleDataSource.AssetDatabaseABDataSource.SetAssetBundleNameAndVariant (System.String assetPath, System.String bundleName, System.String variantName) (at Library/PackageCache/com.unity.assetbundlebrowser@1.7.0/Editor/AssetBundleDataSource/AssetDatabaseABDataSource.cs:62) AssetBundleBrowser.AssetBundleModel.Model+ABMoveData.Apply () (at Library/PackageCache/com.unity.assetbundlebrowser@1.7.0/Editor/AssetBundleModel/ABModel.cs:585) AssetBundleBrowser.AssetBundleModel.Model.ExecuteAssetMove (System.Boolean forceAct) (at Library/PackageCache/com.unity.assetbundlebrowser@1.7.0/Editor/AssetBundleModel/ABModel.cs:621) AssetBundleBrowser.AssetListTree.RemoveAssets (System.Object obj) (at Library/PackageCache/com.unity.assetbundlebrowser@1.7.0/Editor/AssetListTree.cs:336) UnityEditor.GenericMenu.CatchMenu (System.Object userData, System.String[] options, System.Int32 selected) (at :0)

I'm going to restart unity :S

PabloMonfort commented 3 years ago

https://gyazo.com/af875197be3804d54c450318d53e4342 coz its get stuck here :S

PabloMonfort commented 3 years ago

after i restart unity seems to final do what I want it nice 👍