mirror of
https://github.com/Siccity/xNode.git
synced 2025-12-20 09:16:01 +08:00
Fixed an issue with Undo / Redo not working correctly with Odin PropertyTree
This commit is contained in:
parent
d4deeed45b
commit
75a04920b1
@ -39,10 +39,28 @@ namespace XNodeEditor {
|
|||||||
string[] excludes = { "m_Script", "graph", "position", "ports" };
|
string[] excludes = { "m_Script", "graph", "position", "ports" };
|
||||||
|
|
||||||
#if ODIN_INSPECTOR
|
#if ODIN_INSPECTOR
|
||||||
|
try
|
||||||
|
{
|
||||||
|
#if ODIN_INSPECTOR_3
|
||||||
|
objectTree.BeginDraw( true );
|
||||||
|
#else
|
||||||
InspectorUtilities.BeginDrawPropertyTree(objectTree, true);
|
InspectorUtilities.BeginDrawPropertyTree(objectTree, true);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
catch ( ArgumentNullException )
|
||||||
|
{
|
||||||
|
objectTree.EndDraw();
|
||||||
|
NodeEditor.DestroyEditor(this.target);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
GUIHelper.PushLabelWidth( 84 );
|
GUIHelper.PushLabelWidth( 84 );
|
||||||
objectTree.Draw( true );
|
objectTree.Draw( true );
|
||||||
|
#if ODIN_INSPECTOR_3
|
||||||
|
objectTree.EndDraw();
|
||||||
|
#else
|
||||||
InspectorUtilities.EndDrawPropertyTree(objectTree);
|
InspectorUtilities.EndDrawPropertyTree(objectTree);
|
||||||
|
#endif
|
||||||
GUIHelper.PopLabelWidth();
|
GUIHelper.PopLabelWidth();
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
|||||||
@ -58,6 +58,16 @@ namespace XNodeEditor.Internal {
|
|||||||
return editor;
|
return editor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void DestroyEditor( K target )
|
||||||
|
{
|
||||||
|
if ( target == null ) return;
|
||||||
|
T editor;
|
||||||
|
if ( editors.TryGetValue( target, out editor ) )
|
||||||
|
{
|
||||||
|
editors.Remove( target );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static Type GetEditorType(Type type) {
|
private static Type GetEditorType(Type type) {
|
||||||
if (type == null) return null;
|
if (type == null) return null;
|
||||||
if (editorTypes == null) CacheCustomEditors();
|
if (editorTypes == null) CacheCustomEditors();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user