设置Assetbundle名称是选中对应素材的文件夹,他会根据文件夹的名称命名bundle的名称,输出路径可自行更改,初始化的assetbundle.manifast主依赖列表的名称就是输出文件夹的名称
using UnityEngine;
using System.Collections;
using UnityEditor;
using System.IO;
using System.Collections.Generic;
public class BuildAssetBundlesEditor : MonoBehaviour
{
/// <summary>
/// AssetBundleManifestName == 对应AB依赖列表文件
/// </summary>
private static string AssetBundle_BuildDirectory_Path = @Application.streamingAssetsPath + "/../../../" + "AssetBundles";
private static string AssetBundle_TargetDirectory_Path = @Application.streamingAssetsPath + "/" + "ABFiles";
[MenuItem("Tools/Asset Bundle/Build Asset Bundles", false, 0)]
public static void BuildAssetBundleAndroid()
{
//Application.streamingAssetsPath对应的StreamingAssets的子目录