From 12638ec42ebce53aff042e799a10d242ba5df9bf Mon Sep 17 00:00:00 2001 From: uurha Date: Fri, 6 Sep 2024 02:55:40 +0200 Subject: [PATCH] Update SerializeReferenceField --- .../Editor/Drawers/SerializeReferenceField.cs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Assets/BetterCommons/Editor/Drawers/SerializeReferenceField.cs b/Assets/BetterCommons/Editor/Drawers/SerializeReferenceField.cs index 2ea976c..4d8e216 100644 --- a/Assets/BetterCommons/Editor/Drawers/SerializeReferenceField.cs +++ b/Assets/BetterCommons/Editor/Drawers/SerializeReferenceField.cs @@ -137,14 +137,11 @@ private void Update() panel?.visualTree.SendEvent(e); } - //Fix: fixing SerializedPropertyChangeEvent not been sent when set new type to null - if (newType.IsNullOrEmpty()) + //Fix: fixing SerializedPropertyChangeEvent not been sent when set new type to null or time has no sub properties + using (var e = SerializedPropertyChangeEvent.GetPooled(property)) { - using (var e = SerializedPropertyChangeEvent.GetPooled(property)) - { - e.target = PropertyField; - panel?.visualTree.SendEvent(e); - } + e.target = PropertyField; + panel?.visualTree.SendEvent(e); } _referenceType = newType;