Unity 2022 compatibility
This commit is contained in:
parent
fb51cc8914
commit
808bb949cf
@ -54,14 +54,22 @@ namespace NanoBrain.Unity {
|
||||
return EditorGUIUtility.singleLineHeight + propertyExtraHeight;
|
||||
}
|
||||
|
||||
#if UNITY_6000_0_OR_NEWER
|
||||
private readonly Dictionary<EntityId, bool> _invalidCache = new();
|
||||
#else
|
||||
private readonly Dictionary<int, bool> _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;
|
||||
|
||||
|
||||
@ -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))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user