YooAsset/Docs/ShaderVariantCollector.md

40 lines
1.2 KiB
Markdown
Raw Normal View History

2022-07-27 10:25:46 +08:00
# 着色器变种收集
2023-02-23 12:15:41 +08:00
![image](./Image/ShaderVariantCollector-img1.jpg)
2022-07-27 10:25:46 +08:00
点击搜集变种按钮开始收集,请耐心等待结束。
2023-02-16 20:10:50 +08:00
**注意在收集完成之后需要将生成的shadervariants文件配置到收集界面AssetBundle Collector。**
2022-07-27 10:25:46 +08:00
### Jenkins支持
```c#
public static void CollectSVC()
{
string savePath = ShaderVariantCollectorSettingData.Setting.SavePath;
2022-07-27 11:05:12 +08:00
System.Action completedCallback = () =>
2022-07-27 10:25:46 +08:00
{
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);
};
2022-07-27 11:05:12 +08:00
ShaderVariantCollector.Run(savePath, completedCallback);
2022-07-27 10:25:46 +08:00
}
```
```c#
// 命令行调用
%Projects_UnityEngine_Path% -batchmode -projectPath %Projects_UnityProject_Path% -executeMethod ET.CIHelper.CollectSVC -logFile %Projects_UnityProject_Path%/Logs/CIBuildSVC.log
```