using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
public class buildab {
[MenuItem("Publish/Build Bundle")]
public static void BuildBundle()
{
List<AssetBundleBuild> builds = new List<AssetBundleBuild>();
AssetBundleBuild b = new AssetBundleBuild();
b.assetBundleName = "2000.assetbundle";
b.assetNames = new string[] { "Assets/New Material.mat" };
builds.Add(b);
BuildPipeline.BuildAssetBundles("Assets/Bundle", builds.ToArray(), BuildAssetBundleOptions.CollectDependencies | BuildAssetBundleOptions.CompleteAssets, EditorUserBuildSettings.activeBuildTarget);
}
}
时间: 2024-10-06 05:46:39