Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for serialized properties changing fields with reference types #152

Merged
merged 1 commit into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
}
}
}