Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
second setDirty only when component data succesfully updated
  • Loading branch information
wojciech-golowkow committed Jul 30, 2025
commit 137705ea5449b39a7a3fe22fdae26a5f8bab38b0
17 changes: 9 additions & 8 deletions Editor/Tools/UpdateComponentTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,16 @@ public override JObject Execute(JObject parameters)
return McpUnitySocketHandler.CreateErrorResponse(errorMessage, "update_error");
}
}

// Ensure field changes are saved
EditorUtility.SetDirty(gameObject);
if (PrefabUtility.IsPartOfAnyPrefab(gameObject))
{
PrefabUtility.RecordPrefabInstancePropertyModifications(component);
}

}

// Ensure changes are saved
EditorUtility.SetDirty(gameObject);
if (PrefabUtility.IsPartOfAnyPrefab(gameObject))
{
PrefabUtility.RecordPrefabInstancePropertyModifications(component);
}


// Create the response
return new JObject
{
Expand Down