Update YooAssetSetting

增加文件过滤配置
This commit is contained in:
hevinci
2022-09-08 15:55:35 +08:00
parent 3f518ec321
commit 6df57cd3cd
3 changed files with 16 additions and 4 deletions

View File

@@ -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);