unity-mcp/UnityMcpBridge/Editor/Tools
David Sarno 51eb59f04f Fix(MCP): Resolve ValidTRS crash during component serialization
The Unity Editor was crashing with ValidTRS() assertions when attempting to get components from certain GameObjects like the Main Camera.

Investigation revealed the crash occurred during JSON serialization when reflection code accessed specific matrix properties (e.g., Camera.cullingMatrix, Transform.rotation, Transform.lossyScale). Accessing these properties appears to trigger internal Transform state validation failures, potentially due to interactions with the JSON serializer's reflection mechanism.

This fix addresses the issue by:

- Replacing LINQ iteration in GetComponentsFromTarget with a standard loop over a copied list to prevent potential premature serialization interactions.

- Explicitly skipping known problematic Camera matrix properties (cullingMatrix, pixelRect, rect) and generic matrix properties (worldToLocalMatrix, localToWorldMatrix) within GetComponentData's reflection logic.

- Retaining manual serialization for Transform component properties to avoid related reflection issues.
2025-04-10 12:53:01 -07:00
..
CommandRegistry.cs restructured project 2025-04-08 06:14:13 -04:00
CommandRegistry.cs.meta restructured project 2025-04-08 06:14:13 -04:00
ExecuteMenuItem.cs restructured project 2025-04-08 06:14:13 -04:00
ExecuteMenuItem.cs.meta restructured project 2025-04-08 06:14:13 -04:00
ManageAsset.cs restructured project 2025-04-08 06:14:13 -04:00
ManageAsset.cs.meta restructured project 2025-04-08 06:14:13 -04:00
ManageEditor.cs restructured project 2025-04-08 06:14:13 -04:00
ManageEditor.cs.meta restructured project 2025-04-08 06:14:13 -04:00
ManageGameObject.cs Fix(MCP): Resolve ValidTRS crash during component serialization 2025-04-10 12:53:01 -07:00
ManageGameObject.cs.meta restructured project 2025-04-08 06:14:13 -04:00
ManageScene.cs restructured project 2025-04-08 06:14:13 -04:00
ManageScene.cs.meta restructured project 2025-04-08 06:14:13 -04:00
ManageScript.cs restructured project 2025-04-08 06:14:13 -04:00
ManageScript.cs.meta restructured project 2025-04-08 06:14:13 -04:00
ReadConsole.cs restructured project 2025-04-08 06:14:13 -04:00
ReadConsole.cs.meta restructured project 2025-04-08 06:14:13 -04:00