Skip to content

Commit

Permalink
UIToolkit: Fix GetByXPath not save #78
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerTemp committed Oct 19, 2024
1 parent b7954d4 commit d57d00a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Editor/Drawers/XPathDrawers/GetByXPathAttributeDrawer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,7 @@ protected override void OnAwakeUIToolkit(SerializedProperty property, ISaintsAtt

SetValue(initUserData.TargetProperty, initUserData.MemberInfo, parent,
initUserData.CheckFieldResult.TargetValue);
initUserData.TargetProperty.serializedObject.ApplyModifiedProperties();
onValueChangedCallback.Invoke(initUserData.CheckFieldResult.TargetValue);
}
}
Expand All @@ -789,6 +790,7 @@ protected override void OnAwakeUIToolkit(SerializedProperty property, ISaintsAtt
object expectedData = initUserData.CheckFieldResult.TargetValue;
// Debug.Log($"expectedData={expectedData}, targetProp={initUserData.TargetProperty.propertyPath} memberInfo={initUserData.MemberInfo.Name}");
SetValue(initUserData.TargetProperty, initUserData.MemberInfo, parent, expectedData);
initUserData.TargetProperty.serializedObject.ApplyModifiedProperties();
onValueChangedCallback.Invoke(expectedData);
};

Expand All @@ -798,6 +800,7 @@ protected override void OnAwakeUIToolkit(SerializedProperty property, ISaintsAtt
if(arrayIndex == -1)
{
SetValue(initUserData.TargetProperty, initUserData.MemberInfo, parent, null);
initUserData.TargetProperty.serializedObject.ApplyModifiedProperties();
onValueChangedCallback.Invoke(null);
}
else
Expand All @@ -823,6 +826,7 @@ protected override void OnAwakeUIToolkit(SerializedProperty property, ISaintsAtt
newValue =>
{
SetValue(initUserData.TargetProperty, initUserData.MemberInfo, updatedParent, newValue);
initUserData.TargetProperty.serializedObject.ApplyModifiedProperties();
onValueChangedCallback.Invoke(newValue);
}, updatedParent);
};
Expand Down Expand Up @@ -911,6 +915,7 @@ protected override void OnUpdateUIToolkit(SerializedProperty property, ISaintsAt
if (doResignNull || doResignValue)
{
SetValue(initUserData.TargetProperty, initUserData.MemberInfo, parent, checkResult.TargetValue);
initUserData.TargetProperty.serializedObject.ApplyModifiedProperties();
onValueChanged.Invoke(checkResult.TargetValue);
checkResult = new CheckFieldResult
{
Expand Down

0 comments on commit d57d00a

Please sign in to comment.