diff --git a/Editor/ClusterJson_Drawer.cs b/Editor/ClusterJson_Drawer.cs index b2a0d8c..dfb61a7 100644 --- a/Editor/ClusterJson_Drawer.cs +++ b/Editor/ClusterJson_Drawer.cs @@ -54,14 +54,22 @@ namespace NanoBrain.Unity { return EditorGUIUtility.singleLineHeight + propertyExtraHeight; } +#if UNITY_6000_0_OR_NEWER private readonly Dictionary _invalidCache = new(); +#else + private readonly Dictionary _invalidCache = new(); +#endif private bool IsInvalidJson(SerializedProperty jsonFileProp) { TextAsset jsonFile = jsonFileProp.objectReferenceValue as TextAsset; if (jsonFile == null) return false; +#if UNITY_6000_0_OR_NEWER EntityId id = jsonFile.GetEntityId(); +#else + int id = jsonFile.GetInstanceID(); +#endif if (_invalidCache.TryGetValue(id, out bool invalid)) return invalid; diff --git a/Editor/ClusterView.cs b/Editor/ClusterView.cs index 214c7f8..beaef17 100644 --- a/Editor/ClusterView.cs +++ b/Editor/ClusterView.cs @@ -41,7 +41,7 @@ namespace NanoBrain.Unity { #if UNITY_6000_0_OR_NEWER EntityId id = serializedObject.targetObject.GetEntityId(); #else - int id = property.serializedObject.targetObject.GetInstanceID(); + int id = serializedObject.targetObject.GetInstanceID(); #endif string key = id.ToString(); if (!clusterViews.TryGetValue(key, out ClusterView clusterView))