paxohio.blogg.se

Extract textures in unity asset bundles
Extract textures in unity asset bundles











Once all the assets have been loaded, you can unload the asset bundle and you'll still have the assets inside in memory (assuming something is referencing them). From there, individual assets are decompressed and loaded. If you have a compressed asset bundle, what will happen when you load it is the entire compressed asset bundle is loaded into memory. The memory management of asset bundles gets a bit more complex than this too, as far as memory usage is concerned. At runtime, it will be up to you to load the Gun texture bundle along with the Hero1 and/or Hero2 asset bundles, but it will be only loaded a single time.

extract textures in unity asset bundles

You can then build the Hero1 and Hero2 asset bundles, and each of them will not include the Gun texture. The way these work is that at build time, you would create an asset bundle with the Gun texture, and then call AssetBundle.PushAssetDependencies(), passing it the gun texture. The way to get around this is with the asset bundle dependencies. If you load both asset bundles simultaneously you will have 2 copies of the gun texture loaded. If you put hero2 into an asset bundle, it will contain Hero2 and the Gun Texture.

extract textures in unity asset bundles extract textures in unity asset bundles

If you put hero1 into an asset bundle, that asset bundle will contain Hero1 and the Gun Texture. For example, if you have a 2 different player models, Hero1 and Hero2. Dependencies are included in asset bundles automatically, but actually exist in each asset bundle that depends on them, unless you manually removed them. The asset bundle system does not automatically remove anything nor does it load dependencies automatically.













Extract textures in unity asset bundles