mirror of
https://github.com/Siccity/xNode.git
synced 2025-12-21 01:36:03 +08:00
Added undo support and default graph name to SceneGraph
This commit is contained in:
parent
f3b211ed83
commit
f899e48ee0
@ -37,6 +37,7 @@ namespace XNodeEditor {
|
||||
GUI.color = new Color(1, 0.8f, 0.8f);
|
||||
if (GUILayout.Button("Remove")) {
|
||||
removeSafely = false;
|
||||
Undo.RecordObject(sceneGraph, "Removed graph");
|
||||
sceneGraph.graph = null;
|
||||
}
|
||||
GUI.color = Color.white;
|
||||
@ -68,9 +69,9 @@ namespace XNodeEditor {
|
||||
}
|
||||
|
||||
public void CreateGraph(Type type) {
|
||||
serializedObject.Update();
|
||||
Undo.RecordObject(sceneGraph, "Create graph");
|
||||
sceneGraph.graph = ScriptableObject.CreateInstance(type) as NodeGraph;
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
sceneGraph.graph.name = sceneGraph.name + "-graph";
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user