浏览代码

Make cancelling "delete property" cancel the entire operation

/main
Peter Bay Bastian 7 年前
当前提交
010106aa
共有 1 个文件被更改,包括 15 次插入17 次删除
  1. 32
      com.unity.shadergraph/Editor/Drawing/Views/MaterialGraphView.cs

32
com.unity.shadergraph/Editor/Drawing/Views/MaterialGraphView.cs


void DeleteSelectionImplementation(string operationName, GraphView.AskUser askUser)
{
foreach (var selectable in selection)
{
var field = selectable as BlackboardField;
if (field != null && field.userData != null)
{
if (EditorUtility.DisplayDialog("Sub Graph Will Change", "If you remove a property and save the sub graph, you might change other graphs that are using this sub graph.\n\nDo you want to continue?", "Yes", "No"))
break;
return;
}
}
bool userNotified = false;
if (!userNotified)
{
if (EditorUtility.DisplayDialog("Sub Graph Will Change", "If you remove a property and save the sub graph, you might change other graphs that are using this sub graph.\n\nDo you want to continue?", "Yes", "No"))
{
userNotified = true;
}
else
{
return;
}
}
if (userNotified)
{
var property = (IShaderProperty)field.userData;
graph.RemoveShaderProperty(property.guid);
}
var property = (IShaderProperty)field.userData;
graph.RemoveShaderProperty(property.guid);
selection.Clear();
}

正在加载...
取消
保存