diff --git a/Assets/VersionFlow/Editor/BuilderConfigEditor.cs b/Assets/VersionFlow/Editor/BuilderConfigEditor.cs index 72af93e..f2b75e5 100644 --- a/Assets/VersionFlow/Editor/BuilderConfigEditor.cs +++ b/Assets/VersionFlow/Editor/BuilderConfigEditor.cs @@ -1,7 +1,9 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.IO; using System.Linq; +using System.Reflection; using System.Text; using UnityEditor; using UnityEngine; @@ -176,7 +178,7 @@ namespace VersionFlow.Editors var tempColor = GUI.color; if (modeValue == group.BuildMode) GUI.color = Color.green; else GUI.color = Color.white; - if (GUILayout.Button(modeName)) + if (GUILayout.Button(new GUIContent(modeName, GetDescrib(modeValue)))) { group.BuildMode = modeValue; } @@ -267,6 +269,13 @@ namespace VersionFlow.Editors return Color.white; } + + string GetDescrib(T value) where T : Enum + { + var enumType = typeof(T); + var desAtt = enumType.GetField(value.ToString()).GetCustomAttribute(); + return desAtt != null ? desAtt.Description : value.ToString(); + } } private void DrawCompareResult(List compareResult, Dictionary bundleExtraInfo) diff --git a/Assets/VersionFlow/Runtime/BundleManifest.cs b/Assets/VersionFlow/Runtime/BundleManifest.cs index 3e0d0ae..2fb2183 100644 --- a/Assets/VersionFlow/Runtime/BundleManifest.cs +++ b/Assets/VersionFlow/Runtime/BundleManifest.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.IO; using System.Linq; using UnityEditor; @@ -180,6 +181,10 @@ namespace VersionFlow.Runtime assetInfo.BundleName = $"{Folder.name}_{subtopFold}"; } } + else if (BuildMode == EnumBuildMode.OneFolderOnePack) + { + assetInfo.BundleName = $"{Folder.name}"; + } //Unity不允许场景和资源打包到一个bundle中,所以如果该资源是场景,则Bundle名称添加一个后缀 if (assetType == typeof(SceneAsset)) @@ -217,11 +222,17 @@ namespace VersionFlow.Runtime public enum EnumBuildMode { /// 将文件夹下所有Asset打包到一个bundle + [Description("将文件夹下所有Asset打包到一个bundle")] PackTogether, /// 将文件夹下每个Asset打包成一个Bundle + [Description("将文件夹下每个Asset打包成一个Bundle")] OneAssetOnePack, /// 将文件夹下一级文件打包为一个Bundle - SubTopPack + [Description("将文件夹下一级文件打包为一个Bundle")] + SubTopPack, + /// 列表中指定的每一个文件夹打包为一个Bundle + [Description("列表中指定的每一个文件夹打包为一个Bundle")] + OneFolderOnePack } }