Skip to content

Commit

Permalink
Fix for serialized properties changing fields with reference types do…
Browse files Browse the repository at this point in the history
…esn't mark object as dirty
  • Loading branch information
vanifatovvlad committed Jan 24, 2024
1 parent 6a5af4e commit 57e726c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Editor.Extras/Drawers/BuiltinDrawerBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public sealed override void OnGUI(Rect position, TriValue<T> propertyValue, TriE

if (EditorGUI.EndChangeCheck())
{
propertyValue.SmartValue = value;
propertyValue.SetValue(value);
}
}

Expand Down
2 changes: 1 addition & 1 deletion Editor.Extras/Drawers/ObjectReferenceDrawer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public override void OnGUI(Rect position)

if (EditorGUI.EndChangeCheck())
{
_propertyValue.SmartValue = value;
_propertyValue.SetValue(value);
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions Editor/TriValue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,11 @@ public T SmartValue
Property.SetValue(value);
}
}

[PublicAPI]
public void SetValue(T value)
{
Property.SetValue(value);
}
}
}

0 comments on commit 57e726c

Please sign in to comment.