打包模式新增按文件夹打包
This commit is contained in:
parent
f3aa411e51
commit
a90fbe1d0a
@ -1,7 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
@ -176,7 +178,7 @@ namespace VersionFlow.Editors
|
|||||||
var tempColor = GUI.color;
|
var tempColor = GUI.color;
|
||||||
if (modeValue == group.BuildMode) GUI.color = Color.green;
|
if (modeValue == group.BuildMode) GUI.color = Color.green;
|
||||||
else GUI.color = Color.white;
|
else GUI.color = Color.white;
|
||||||
if (GUILayout.Button(modeName))
|
if (GUILayout.Button(new GUIContent(modeName, GetDescrib(modeValue))))
|
||||||
{
|
{
|
||||||
group.BuildMode = modeValue;
|
group.BuildMode = modeValue;
|
||||||
}
|
}
|
||||||
@ -267,6 +269,13 @@ namespace VersionFlow.Editors
|
|||||||
|
|
||||||
return Color.white;
|
return Color.white;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string GetDescrib<T>(T value) where T : Enum
|
||||||
|
{
|
||||||
|
var enumType = typeof(T);
|
||||||
|
var desAtt = enumType.GetField(value.ToString()).GetCustomAttribute<DescriptionAttribute>();
|
||||||
|
return desAtt != null ? desAtt.Description : value.ToString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawCompareResult(List<BundleCompare> compareResult, Dictionary<string, BundleExtraInfo> bundleExtraInfo)
|
private void DrawCompareResult(List<BundleCompare> compareResult, Dictionary<string, BundleExtraInfo> bundleExtraInfo)
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
@ -180,6 +181,10 @@ namespace VersionFlow.Runtime
|
|||||||
assetInfo.BundleName = $"{Folder.name}_{subtopFold}";
|
assetInfo.BundleName = $"{Folder.name}_{subtopFold}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (BuildMode == EnumBuildMode.OneFolderOnePack)
|
||||||
|
{
|
||||||
|
assetInfo.BundleName = $"{Folder.name}";
|
||||||
|
}
|
||||||
|
|
||||||
//Unity不允许场景和资源打包到一个bundle中,所以如果该资源是场景,则Bundle名称添加一个后缀
|
//Unity不允许场景和资源打包到一个bundle中,所以如果该资源是场景,则Bundle名称添加一个后缀
|
||||||
if (assetType == typeof(SceneAsset))
|
if (assetType == typeof(SceneAsset))
|
||||||
@ -217,11 +222,17 @@ namespace VersionFlow.Runtime
|
|||||||
public enum EnumBuildMode
|
public enum EnumBuildMode
|
||||||
{
|
{
|
||||||
/// <summary> 将文件夹下所有Asset打包到一个bundle </summary>
|
/// <summary> 将文件夹下所有Asset打包到一个bundle </summary>
|
||||||
|
[Description("将文件夹下所有Asset打包到一个bundle")]
|
||||||
PackTogether,
|
PackTogether,
|
||||||
/// <summary> 将文件夹下每个Asset打包成一个Bundle </summary>
|
/// <summary> 将文件夹下每个Asset打包成一个Bundle </summary>
|
||||||
|
[Description("将文件夹下每个Asset打包成一个Bundle")]
|
||||||
OneAssetOnePack,
|
OneAssetOnePack,
|
||||||
/// <summary> 将文件夹下一级文件打包为一个Bundle </summary>
|
/// <summary> 将文件夹下一级文件打包为一个Bundle </summary>
|
||||||
SubTopPack
|
[Description("将文件夹下一级文件打包为一个Bundle")]
|
||||||
|
SubTopPack,
|
||||||
|
/// <summary> 列表中指定的每一个文件夹打包为一个Bundle </summary>
|
||||||
|
[Description("列表中指定的每一个文件夹打包为一个Bundle")]
|
||||||
|
OneFolderOnePack
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user