From 57e726cc4f2c8d3488011f312d5b22dab2b19dc5 Mon Sep 17 00:00:00 2001 From: VladV Date: Wed, 24 Jan 2024 13:58:07 +0400 Subject: [PATCH] Fix for serialized properties changing fields with reference types doesn't mark object as dirty --- Editor.Extras/Drawers/BuiltinDrawerBase.cs | 2 +- Editor.Extras/Drawers/ObjectReferenceDrawer.cs | 2 +- Editor/TriValue.cs | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Editor.Extras/Drawers/BuiltinDrawerBase.cs b/Editor.Extras/Drawers/BuiltinDrawerBase.cs index 99cb1a0..baafe31 100644 --- a/Editor.Extras/Drawers/BuiltinDrawerBase.cs +++ b/Editor.Extras/Drawers/BuiltinDrawerBase.cs @@ -36,7 +36,7 @@ namespace TriInspector.Drawers if (EditorGUI.EndChangeCheck()) { - propertyValue.SmartValue = value; + propertyValue.SetValue(value); } } diff --git a/Editor.Extras/Drawers/ObjectReferenceDrawer.cs b/Editor.Extras/Drawers/ObjectReferenceDrawer.cs index f8f3f7a..e77dc1e 100644 --- a/Editor.Extras/Drawers/ObjectReferenceDrawer.cs +++ b/Editor.Extras/Drawers/ObjectReferenceDrawer.cs @@ -46,7 +46,7 @@ namespace TriInspector.Drawers if (EditorGUI.EndChangeCheck()) { - _propertyValue.SmartValue = value; + _propertyValue.SetValue(value); } } } diff --git a/Editor/TriValue.cs b/Editor/TriValue.cs index 862c80b..2fb0d93 100644 --- a/Editor/TriValue.cs +++ b/Editor/TriValue.cs @@ -33,5 +33,11 @@ namespace TriInspector Property.SetValue(value); } } + + [PublicAPI] + public void SetValue(T value) + { + Property.SetValue(value); + } } } \ No newline at end of file