YooAsset/Docs/ShaderVariantCollector.md

40 lines
1.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# 着色器变种收集
![image](./Image/ShaderVariantCollector-img1.jpg)
点击搜集变种按钮开始收集,请耐心等待结束。
**注意在收集完成之后需要将生成的shadervariants文件配置到收集界面AssetBundle Collector。**
### Jenkins支持
```c#
public static void CollectSVC()
{
string savePath = ShaderVariantCollectorSettingData.Setting.SavePath;
System.Action completedCallback = () =>
{
ShaderVariantCollection collection =
AssetDatabase.LoadAssetAtPath<ShaderVariantCollection>(savePath);
if (collection != null)
{
Debug.Log($"ShaderCount : {collection.shaderCount}");
Debug.Log($"VariantCount : {collection.variantCount}");
}
else
{
throw new Exception("Failed to Collect shader Variants.");
}
EditorTools.CloseUnityGameWindow();
EditorApplication.Exit(0);
};
ShaderVariantCollector.Run(savePath, completedCallback);
}
```
```c#
// 命令行调用
%Projects_UnityEngine_Path% -batchmode -projectPath %Projects_UnityProject_Path% -executeMethod ET.CIHelper.CollectSVC -logFile %Projects_UnityProject_Path%/Logs/CIBuildSVC.log
```