浏览代码

Fixed issue that was causing the upgrader to ignore zero selected materials message when pressing dialog x button

/tag-1.1.4-preview
Felipe Lira 7 年前
当前提交
7647c889
共有 1 个文件被更改,包括 8 次插入4 次删除
  1. 12
      ScriptableRenderPipeline/Core/CoreRP/Editor/MaterialUpgrader.cs

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


var selection = Selection.objects;
if (selection == null)
if (EditorUtility.DisplayDialog(DialogText.title, DialogText.noSelectionMessage, DialogText.ok))
return;
{
EditorUtility.DisplayDialog(DialogText.title, DialogText.noSelectionMessage, DialogText.ok);
return;
}
List<Material> selectedMaterials = new List<Material>(selection.Length);
for (int i = 0; i < selection.Length; ++i)

int selectedMaterialsCount = selectedMaterials.Count;
if (selectedMaterialsCount == 0)
if (EditorUtility.DisplayDialog(DialogText.title, DialogText.noSelectionMessage, DialogText.ok))
return;
{
EditorUtility.DisplayDialog(DialogText.title, DialogText.noSelectionMessage, DialogText.ok);
return;
}
if (!EditorUtility.DisplayDialog(DialogText.title, string.Format("The upgrade will overwrite {0} selected material{1}. ", selectedMaterialsCount, selectedMaterialsCount > 1 ? "s" : "") +
DialogText.projectBackMessage, DialogText.proceed, DialogText.cancel))

正在加载...
取消
保存