请 don't recommend 我 Unity3d official links 我试过了它并不全面,也没有提供必要的细节 . 我是新手,将在Unity3d中制作 AssetBundles . 到目前为止,在统一官员docs的帮助下,下面给出的是什么 .
/// <summary>
/// AssetBundles are exported from the editor using script code. (This is similar to the 4.x approach.)
/// The following script exports AssetBundles.
/// </summary>
public class AssetBundleCreate {
[MenuItem("Assets/Build AssetBundles")]
static void BuildAllAssetBundles() {
Debug.Log("asset build");
BuildPipeline.BuildAssetBundles("Assets/AssetBundles");
}
[MenuItem("Assets/Get AssetBundle Names")]
static void GetNames() {
var names = AssetDatabase.GetAllAssetBundleNames();
foreach(var name in names){
Debug.Log("AssetBundle name is : " + name);
}
}
}
但是代码没有生成任何资产包而是它已经制作了 . 文件和.abc扩展名文件 . 我缺少什么,也 Share proper guide about Creating and Downloading Asset bundle from local server/pc in Unity 5
2 回答
你应该看看高级AssetBundleManager https://unity3d.com/learn/tutorials/topics/scripting/assetbundles-and-assetbundle-manager
我们正在创建的Assetbundle是 platform specific: 要创建AssetBundle,只需编写一个C#脚本并将其放在 Editor 文件夹中: Assets > Editor 这里我提供ex . android特定平台:
之后你可以放置target.unity3d文件 locally or on remote server :记住在android平台上我们必须使用下面提供的WWW类 . [imp]现在我们还可以在assetsbundle中包含脚本:只需尝试下面的脚本,你必须将这个脚本附加到你要导入AssetBundle的场景中的空游戏对象:
如果您对导出脚本不感兴趣,那么只需从给定脚本中跳过以下部分: