浏览代码

Change tracking using undo system

/main
Tim Cooper 7 年前
当前提交
7492cebb
共有 2 个文件被更改,包括 10 次插入3 次删除
  1. 9
      MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Implementation/SerializableGraphObject.cs
  2. 4
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/MaterialGraphEditWindow.cs

9
MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Implementation/SerializableGraphObject.cs


[SerializeField]
SerializationHelper.JSONSerializedElement m_SerializedGraph;
[SerializeField]
bool m_IsDirty;
IGraph m_Graph;
IGraph m_DeserializedGraph;

}
}
public bool isDirty
{
get { return m_IsDirty; }
}
m_IsDirty = true;
}
public void OnBeforeSerialize()

4
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/MaterialGraphEditWindow.cs


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"))
{
if (graphObject.isDirty && 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"))
}
Undo.ClearUndo(graphObject);
DestroyImmediate(graphObject);
graphEditorView = null;

正在加载...
取消
保存