-
Notifications
You must be signed in to change notification settings - Fork 40
Added generic value support for generators #169
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -28,9 +28,55 @@ public static FieldInfo GetFieldInfoFromPathByType(this SerializedProperty prope | |||||||||
|
|
||||||||||
| return fieldInfo; | ||||||||||
| } | ||||||||||
| public static void SetValue(this SerializedProperty serializedProperty, object value) | ||||||||||
|
|
||||||||||
| public static void SetValueReflective(this SerializedProperty prop, object value) | ||||||||||
| { | ||||||||||
| object root = prop.serializedObject.targetObject; | ||||||||||
|
|
||||||||||
| string[] parts = prop.propertyPath | ||||||||||
| .Replace(".Array.data[", "[") | ||||||||||
| .Split('.'); | ||||||||||
|
Comment on lines
+36
to
+38
|
||||||||||
| string[] parts = prop.propertyPath | |
| .Replace(".Array.data[", "[") | |
| .Split('.'); | |
| string[] parts = ParsePropertyPath(prop.propertyPath); |
Copilot
AI
May 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Calling Update() and ApplyModifiedProperties() inside the reflective setter may lead to repeated serialization passes when setting multiple properties. It might be more efficient to push these calls to the caller.
| prop.serializedObject.Update(); | |
| prop.serializedObject.ApplyModifiedProperties(); | |
| // Note: The caller is responsible for calling `Update()` and `ApplyModifiedProperties()` | |
| // on the `SerializedObject` to apply changes and update the serialized state. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Public extension methods should have XML doc comments. Please add a summary and parameter descriptions for
SetValueReflective.