Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to resolve is auto included in multiple bundles #120

Open
MuhammadFaizanKhan opened this issue Apr 1, 2019 · 7 comments
Open

How to resolve is auto included in multiple bundles #120

MuhammadFaizanKhan opened this issue Apr 1, 2019 · 7 comments

Comments

@MuhammadFaizanKhan
Copy link

MuhammadFaizanKhan commented Apr 1, 2019

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
Copy link
Contributor

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/[email protected]/manual/index.html

@MuhammadFaizanKhan
Copy link
Author

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/[email protected]/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
Copy link
Contributor

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
Copy link

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
Copy link

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/[email protected]/Editor/AssetBundleDataSource/AssetDatabaseABDataSource.cs:62)
AssetBundleBrowser.AssetBundleModel.Model+ABMoveData.Apply () (at Library/PackageCache/[email protected]/Editor/AssetBundleModel/ABModel.cs:585)
AssetBundleBrowser.AssetBundleModel.Model.ExecuteAssetMove (System.Boolean forceAct) (at Library/PackageCache/[email protected]/Editor/AssetBundleModel/ABModel.cs:621)
AssetBundleBrowser.AssetListTree.RemoveAssets (System.Object obj) (at Library/PackageCache/[email protected]/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
Copy link

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

@PabloMonfort
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants