mirror of
https://github.com/tuyoogame/YooAsset.git
synced 2026-05-26 02:30:18 +00:00
Update YooAssetSetting
增加文件过滤配置
This commit is contained in:
@@ -118,6 +118,4 @@ namespace YooAsset.Editor
|
|||||||
return StringUtility.StringToStringList(BuildinTags, ';');
|
return StringUtility.StringToStringList(BuildinTags, ';');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -208,12 +208,21 @@ namespace YooAsset.Editor
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
string ext = System.IO.Path.GetExtension(assetPath);
|
string fileExtension = System.IO.Path.GetExtension(assetPath);
|
||||||
if (ext == "" || ext == ".dll" || ext == ".cs" || ext == ".js" || ext == ".boo" || ext == ".meta" || ext == ".cginc")
|
if (IsIgnoreFile(fileExtension))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
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)
|
private bool IsCollectAsset(string assetPath)
|
||||||
{
|
{
|
||||||
Type assetType = AssetDatabase.GetMainAssetTypeAtPath(assetPath);
|
Type assetType = AssetDatabase.GetMainAssetTypeAtPath(assetPath);
|
||||||
|
|||||||
@@ -45,5 +45,10 @@ namespace YooAsset
|
|||||||
/// Unity着色器资源包名称
|
/// Unity着色器资源包名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const string UnityShadersBundleName = "unityshaders";
|
public const string UnityShadersBundleName = "unityshaders";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 忽略的文件类型
|
||||||
|
/// </summary>
|
||||||
|
public static readonly string[] IgnoreFileExtensions = { "", ".so", ".dll", ".cs", ".js", ".boo", ".meta", ".cginc" };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user