打包AB包1

public static string ABCONFIGPATH = “Assets/Editor/ABConfig.asset”;
[MenuItem(“Assets/BuildAssetBundles”)]
static void BuildAssetBundles()
{
//清除之前产生的AB包
m_AllFileDir.Clear();
ABConfig abConfig = AssetDatabase.LoadAssetAtPath(ABCONFIGPATH);
//一般先处理文件夹。再处理文件
foreach (ABConfig.FilDirABName filDir in abConfig.m_AllFileName)
{
if (m_AllFileDir.ContainsKey(filDir.ABName))
{
Debug.Log(“ab包配置名字重复,请检查”);
}
else
{
m_AllFileDir.Add(filDir.ABName ,filDir.Path);
m_AllFileAB.Add(filDir.Path );
}
}
string[] allstr = AssetDatabase.FindAssets(“t:Prefab”, abConfig.m_AllPrefabPath.ToArray());
for(int i = 0; i < allstr.Length; i++)
{
//根据GUID找到路径
string path = AssetDatabase.GUIDToAssetPath(allstr[i]);
//设置进度条 更好的看到打包的进度
EditorUtility.DisplayProgressBar(“查找prefab”, “Prefab:” + path, i * 1.0f / allstr.Length);
//清除进度条
EditorUtility.ClearProgressBar();

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值