For serialized properties changing fields with reference types (AnimationCurve, Gradient) doesn't mark object as dirty
Expected behavior
After changing values object marks as dirty
Code Sample
Changing values inside testField works as intended, but not for TestProperty
public class CurveTest : MonoBehaviour
{
public NestedReferenceTest testField;
[ShowInInspector]
[InlineProperty]
[HideLabel]
[PropertySpace]
public NestedReferenceTest TestProperty
{
get => testField;
set => testField = value;
}
}
[Serializable]
public class NestedReferenceTest
{
public AnimationCurve curve;
public Gradient gradient;
public float floatValue;
}
The problem is in the TriValue.SmartValue I suppose - comparer for reference values always returns true
[PublicAPI]
public T SmartValue
{
get => (T) Property.Value;
set
{
if (Property.Comparer.Equals(Property.Value, value))
{
return;
}
Property.SetValue(value);
}
}
Desktop: Windows 10
Unity version: 2022.3.16f1
Tri Inspector version: 1.13.2
Describe the bug
For serialized properties changing fields with reference types (AnimationCurve, Gradient) doesn't mark object as dirty
Expected behavior After changing values object marks as dirty
Code Sample
Changing values inside testField works as intended, but not for TestProperty
The problem is in the TriValue.SmartValue I suppose - comparer for reference values always returns true
Desktop: Windows 10 Unity version: 2022.3.16f1 Tri Inspector version: 1.13.2