浏览代码

Add save dialog when closing window

/main
Peter Bay Bastian 7 年前
当前提交
3c039bfd
共有 1 个文件被更改,包括 8 次插入8 次删除
  1. 16
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/AbstractMaterialGraphEditWindow.cs

16
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/AbstractMaterialGraphEditWindow.cs


rootVisualContainer.Clear();
}
void OnDestroy()
{
if (EditorUtility.DisplayDialog("Shader Graph Might Have Been Modified", "Do you want to save the changes you made in the shader graph?", "Save", "Don't Save"))
{
UpdateAsset();
}
}
void OnGUI()
{
var presenter = m_GraphEditorView.presenter;

if (selected == newSelection)
return;
if (selected != null)
{
if (EditorUtility.DisplayDialog("Save Old Graph?", "Save Old Graph?", "yes!", "no"))
{
UpdateAsset();
}
}
selected = newSelection;

正在加载...
取消
保存