In Unity 4.*, I can use BuildPipeline.BuildAssetBundleExplicitAssetNames(…) to build a AssetBundle with explicit asset name. In run time, load asset form AssetBundle.
In Unity3d 5.0, the function is obsolete (also can be used , but have problem I described below). So I use BuildPipeline.BuildAssetBundles(…) to instead. But there are some problems.
For example, there is an AssetBundle, named “lua.unity3d”. In which, there are two assets,“Assets/LuaScript/launcher.lua.bytes”and “Assets/LuaScript/miniglobalDef.lua.bytes”. I can use AssetBundle.LoadAsset( “launcher.lua.bytes”) to load first assets, but when use AssetBundle.LoadAsset( “miniglobalDef.lua.bytes”), just get null. So I use “Assets/LuaScript/miniglobalDef.lua.bytes” to get it.
There are more Problem. when I use AssetBundle.LoadAsset(“utils.lua.bytes”) and AssetBundle.LoadAsset(”start/ utils.lua.bytes”) , which are different assets. I can only get the “start/utils.lua.bytes”.
I feel very puzzled. So I decide to use whole path like “Assets/……”. Oh, very long string.
Is there any people can tell the rules. Why can use AssetBundle.LoadAsset( “launcher.lua.bytes”), and can not use AssetBundle.LoadAsset( “miniglobalDef.lua.bytes”)? Is this function use param “string name”like a path and will sreach path to match name?
The Vesion is Unity5.0.0 f4
Thank You!