This appears correct. Three bundles were built, one for each material and they both list the sharedtexture bundle as a dependency. This means your texture asset is built only once and is correctly referenced. What were you expecting to see?
In the project attached above, there are three assets in the BundleAsset folder:
2. B.mat -> BundleName: b (using NoceEffectGrame.png)
3. NoceEffectGrame.png-> BundleName: sharedtexture (The file size of the texture is 192KB.)```
In the above state, if you create a bundle, the following bundle file is created.
```a (size 249KB)
b (size 249KB)
sharedtexture (size 203KB)```
The dependency information in the manifest file is correct.
```ManifestFileVersion: 0
CRC: 5339008
AssetBundleManifest:
AssetBundleInfos:
Info_0:
Name: sharedtexture
Dependencies: {}
Info_1:
Name: b
Dependencies:
Dependency_0: sharedtexture
Info_2:
Name: a
Dependencies:
Dependency_0: sharedtexture```
However, the file size seems odd.
Is this the normal bundle size? Or is there a problem with the bundle creation process?
I see the same as you, however try adding more textures and materials referencing them and you’ll see the filesize of the materials won’t get bigger, but the sharedtexture will. I have a suspicioni the materials are larger than expected because a copy of the shaders is included.
Thank you for answer.
Like you said, it seems to be related to Material and Shader,
I tried to make a bundle using prefab, but things got worse.
All assets have the same texture, and the manifest’s dependency information is correct.
Assetbundle resource
2. B.mat -> BundleName: b (using NoceEffectGrame.png)
2. C.prefab -> BundleName: c (reference NoceEffectGrame.png)
2. D.prefab -> BundleName: d (reference NoceEffectGrame.png)
3. NoceEffectGrame.png-> BundleName: sharedtexture (The file size of the texture is 192KB.)```
**Created assetbundle size**
```a 249KB
b 249KB
c 200KB
d 200KB
sharedtexture 203KB```
[5068460--498188--Patch2019_Prefab.zip|attachment](upload://sTGfg3MD5IBoo3MH6J7qlMr127X.zip) (144 KB)
Thank you for answer.
I think this is a very important issue for developing a patch system.
I’m curious if other people have created a patch system without fixing this problem.
I have the same question as you
finally, i find the problem
the sprite must texture, instead of sprite, then solve the problem
because if you set sprite mode, the material dependence the sprite instead of texture,so there have two of it.