Http://www.58player.com/blog-2537-85030.html
I used the Assetbundle solution because of the need for a UI hot update in the project.
In general, we use Assetbundle to generate resource bundles commonly used scenarios such as the following:
Using Unityengine;
Using Unityeditor;
<summary>
Export Resource Class
</summary>
public class Exportgameresources
{
static buildassetbundleoptions m_option = Buildassetbundleoptions.collectdependencies | Collect all dependencies
Buildassetbundleoptions.deterministicassetbundle;
<summary>
Export Ngui into Assetbundle
</summary>
[MenuItem ("assets/Export/resource")]
static public void Exportngui ()
{
Gets the selected item in the editor
object[] Objs = selection.getfiltered (typeof (Object), selectionmode.deepassets);
No items selected
if (OBJS. Length = = 0)
{
Return
}
string _savepath = null;
Judging whether it's a multi-choice or a radio
if (OBJS. Length = = 1)
{
Get Save Path
_savepath = Editorutility.savefilepanel ("Save Resource", "" ", Objs[0].name," Assetbundle ");
Generate Assetbundle
Buildpipeline.buildassetbundle (objs[0], NULL,
_savepath,
M_option,
Editoruserbuildsettings.activebuildtarget);
}
Else
{
Get Save Path
_savepath = Editorutility.savefolderpanel ("Save Resources", "", "" ");
Generate Assetbundle
for (int i = 0; i < Objs. Length; ++i)
{
Buildpipeline.buildassetbundle (Objs[i], NULL,
_savepath + "/" + Objs[i].name + ". Assetbundle",
M_option,
Editoruserbuildsettings.activebuildtarget);
}
}
}
}
This is the way I first wrote about packaging Ngui precast pieces into Assetbundle. This method does not seem to be a problem, and using WWW stream loading is no problem. But is it true?
In fact, I didn't notice the problem of resource dependency in Assetbundle in the beginning.
Because the first few Assetbundle0 that I generated were the few precast parts in the Ngui demo, the resulting size was normally several k to dozens of K.
So I naively thought it would be good to use it.
I did not find myself jumping into a small hole until I started to do several interfaces that required Chinese text support.
Todo:.................
PS: This blog does not count what professional technical blog, just essays.
[Unity3d][ngui] packaging NGUI precast parts into Assetbundle two ideas.