浏览代码

Material upgrader now displays a dialog informing that at least one material must be selected when clicking on upgrade selection option.

/main
Felipe Lira 7 年前
当前提交
f53d33dc
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6
      ScriptableRenderPipeline/Core/CoreRP/Editor/MaterialUpgrader.cs

6
ScriptableRenderPipeline/Core/CoreRP/Editor/MaterialUpgrader.cs


public static void UpgradeSelection(List<MaterialUpgrader> upgraders, string progressBarName, UpgradeFlags flags = UpgradeFlags.None)
{
var selection = Selection.objects;
if (selection == null || selection.Length == 0)
if (EditorUtility.DisplayDialog("Material Upgrader", "You must select at least one material.", "Ok"))
return;
Debug.Log(selection.Length);
for (int i = 0; i < selection.Length; i++)
{
if (UnityEditor.EditorUtility.DisplayCancelableProgressBar(progressBarName, string.Format("({0} of {1}) {2}", i, selection.Length, lastMaterialName), (float)i / (float)selection.Length))

正在加载...
取消
保存