diff --git a/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollector.cs b/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollector.cs index f0ad20b..d0e9803 100644 --- a/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollector.cs +++ b/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollector.cs @@ -251,7 +251,7 @@ namespace YooAsset.Editor // 检测原生文件是否合规 if (isRawFilePackRule) { - string extension = StringUtility.RemoveFirstChar(System.IO.Path.GetExtension(assetPath)); + string extension = EditorTools.RemoveFirstChar(System.IO.Path.GetExtension(assetPath)); if (extension == EAssetFileExtension.unity.ToString() || extension == EAssetFileExtension.prefab.ToString() || extension == EAssetFileExtension.fbx.ToString() || extension == EAssetFileExtension.mat.ToString() || extension == EAssetFileExtension.controller.ToString() || extension == EAssetFileExtension.anim.ToString() || diff --git a/Assets/YooAsset/Editor/AssetBundleCollector/DefaultPackRule.cs b/Assets/YooAsset/Editor/AssetBundleCollector/DefaultPackRule.cs index 72eef45..8f6c462 100644 --- a/Assets/YooAsset/Editor/AssetBundleCollector/DefaultPackRule.cs +++ b/Assets/YooAsset/Editor/AssetBundleCollector/DefaultPackRule.cs @@ -40,7 +40,7 @@ namespace YooAsset.Editor { PackRuleResult IPackRule.GetPackRuleResult(PackRuleData data) { - string bundleName = StringUtility.RemoveExtension(data.AssetPath); + string bundleName = PathUtility.RemoveExtension(data.AssetPath); PackRuleResult result = new PackRuleResult(bundleName, DefaultPackRule.AssetBundleFileExtension); return result; } @@ -125,7 +125,7 @@ namespace YooAsset.Editor } else { - bundleName = StringUtility.RemoveExtension(collectPath); + bundleName = PathUtility.RemoveExtension(collectPath); } PackRuleResult result = new PackRuleResult(bundleName, DefaultPackRule.AssetBundleFileExtension); diff --git a/Assets/YooAsset/Editor/EditorTools.cs b/Assets/YooAsset/Editor/EditorTools.cs index a03830f..9cc3c2d 100644 --- a/Assets/YooAsset/Editor/EditorTools.cs +++ b/Assets/YooAsset/Editor/EditorTools.cs @@ -286,6 +286,18 @@ namespace YooAsset.Editor #endregion #region StringUtility + public static string RemoveFirstChar(string str) + { + if (string.IsNullOrEmpty(str)) + return str; + return str.Substring(1); + } + public static string RemoveLastChar(string str) + { + if (string.IsNullOrEmpty(str)) + return str; + return str.Substring(0, str.Length - 1); + } public static List StringToStringList(string str, char separator) { List result = new List(); @@ -303,7 +315,6 @@ namespace YooAsset.Editor } return result; } - public static T NameToEnum(string name) { if (Enum.IsDefined(typeof(T), name) == false)