From b787b57eb33f8dcf651bcc7968cb1ddd518210f2 Mon Sep 17 00:00:00 2001 From: Thor Brigsted Date: Wed, 7 Feb 2018 18:17:37 +0100 Subject: [PATCH] Revert "Minor performance improvement (cachine serialized objects)" This reverts commit dba4cd18429d0d2800d7391708f96da037ba8ce9. --- Scripts/Editor/NodeEditorBase.cs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/Scripts/Editor/NodeEditorBase.cs b/Scripts/Editor/NodeEditorBase.cs index 0868ce0..14ef5ce 100644 --- a/Scripts/Editor/NodeEditorBase.cs +++ b/Scripts/Editor/NodeEditorBase.cs @@ -10,7 +10,6 @@ namespace XNodeEditor.Internal { public class NodeEditorBase where A : Attribute, NodeEditorBase.INodeEditorAttrib where T : NodeEditorBase where K : ScriptableObject { /// Custom editors defined with [CustomNodeEditor] private static Dictionary editors; - private static Dictionary serializeds; public K target; public SerializedObject serializedObject; @@ -19,17 +18,10 @@ namespace XNodeEditor.Internal { Type type = target.GetType(); T editor = GetEditor(type); editor.target = target; - editor.serializedObject = GetSerialized(target); + editor.serializedObject = new SerializedObject(target); return editor; } - private static SerializedObject GetSerialized(K target) { - if (target == null) return null; - if (serializeds == null) serializeds = new Dictionary(); - if (!serializeds.ContainsKey(target)) serializeds.Add(target, new SerializedObject(target)); - return serializeds[target]; - } - private static T GetEditor(Type type) { if (type == null) return null; if (editors == null) CacheCustomEditors();