Hi. I’m having difficulties with assetbundling. But I don’t know how to approach this kinda problem.
Let’s assume I’m building android application.
I have a font asset, let’s call it “font.ttf” which is 4mb.
In startup scene, scene has UGUI that uses font.ttf. This scene doesn’t get into assetbundle. It will be included in apk.
And I have 100 prefab that uses “font.ttf” and this prefab will be assetbundled separately. So it would be like 100 assetbundle right?
The problem is, According to this article, those 100 assetbundle will include “font.ttf” individually. So every assetbundle will have its own separate “font.ttf”, so redundant 396mb is used just for those fonts.
To avoid such this problem is, making “font.ttf” as an assetbundle, then those other 100 assetbundle will know that the font depend on “font.ttf” assetbundle and not include it.
But the problem is, if I assetbundle the font, when in startup scene which didn’t downloaded the assetbundles at all, UGUI cannot use “font.ttf” so it won’t show any font.
Question is, how do I order BuildPipeline.BuildAssetBundles() to not to include “font.ttf”, and instead just use in the actual build? I saw “BuildAssetBundleOptions.CollectDependencies” is deprecated and became mandatory.
Is it inevitable? Do I have to just have one font for build, and one font for assetbundle?