diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildParameters.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildParameters.cs index 943f5d6..bcaa536 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildParameters.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildParameters.cs @@ -118,6 +118,4 @@ namespace YooAsset.Editor return StringUtility.StringToStringList(BuildinTags, ';'); } } - - } \ No newline at end of file diff --git a/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollector.cs b/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollector.cs index df40e99..d4c332e 100644 --- a/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollector.cs +++ b/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollector.cs @@ -208,12 +208,21 @@ namespace YooAsset.Editor } */ - string ext = System.IO.Path.GetExtension(assetPath); - if (ext == "" || ext == ".dll" || ext == ".cs" || ext == ".js" || ext == ".boo" || ext == ".meta" || ext == ".cginc") + string fileExtension = System.IO.Path.GetExtension(assetPath); + if (IsIgnoreFile(fileExtension)) return false; return true; } + private bool IsIgnoreFile(string fileExtension) + { + foreach (var extension in YooAssetSettings.IgnoreFileExtensions) + { + if (extension == fileExtension) + return true; + } + return false; + } private bool IsCollectAsset(string assetPath) { Type assetType = AssetDatabase.GetMainAssetTypeAtPath(assetPath); diff --git a/Assets/YooAsset/Runtime/Settings/YooAssetSettings.cs b/Assets/YooAsset/Runtime/Settings/YooAssetSettings.cs index a63bc3d..8a801c9 100644 --- a/Assets/YooAsset/Runtime/Settings/YooAssetSettings.cs +++ b/Assets/YooAsset/Runtime/Settings/YooAssetSettings.cs @@ -45,5 +45,10 @@ namespace YooAsset /// Unity着色器资源包名称 /// public const string UnityShadersBundleName = "unityshaders"; + + /// + /// 忽略的文件类型 + /// + public static readonly string[] IgnoreFileExtensions = { "", ".so", ".dll", ".cs", ".js", ".boo", ".meta", ".cginc" }; } } \ No newline at end of file