Refactored MCP tools #2
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request refactors and reorganizes the data models and tool responses for the ParticleSystem editor integration. The main changes include moving response models into their own files and namespaces, improving validation and error handling, and updating utility usage for better maintainability.
Refactoring and Code Organization:
GetParticleSystemResponseandModifyParticleSystemResponseclasses out ofParticleSystemData.csinto their own dedicated files (GetParticleSystemResponse.csandModifyParticleSystemResponse.cs) under thecom.IvanMurzak.Unity.MCP.ParticleSystem.Editornamespace for better separation of concerns. [1] [2] [3].metafiles for Unity asset management. [1] [2] [3].Editor.APIto.Editorfor consistency and clarity across the codebase. [1] [2] [3] [4] [5]Validation and Error Handling Improvements:
gameObjectRefin both theGetandModifymethods, throwing clear exceptions when the reference is invalid or null, and replaced usage of the removedErrorstatic class with direct error messages. [1] [2] [3] [4] [5]componentRefvalidity to use the newIsValid(out _)signature for improved robustness. [1] [2]Utility and Maintenance Updates:
UnityEditorInternal.InternalEditorUtility.RepaintAllViews()withEditorUtils.RepaintAllEditorWindows()for editor refreshes, likely for improved compatibility or abstraction.These changes collectively improve code modularity, testability, and maintainability, while making error handling more explicit and robust.