unity-mcp/UnityMcpBridge/Editor
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
..
Data restructured project 2025-04-08 06:14:13 -04:00
Helpers Fix(MCP): Resolve ValidTRS crash during component serialization 2025-04-10 12:53:01 -07:00
Models restructured project 2025-04-08 06:14:13 -04:00
Tools Fix(MCP): Resolve ValidTRS crash during component serialization 2025-04-10 12:53:01 -07:00
Windows linting and removed unused properties 2025-04-09 09:10:21 -04:00
Data.meta restructured project 2025-04-08 06:14:13 -04:00
Helpers.meta restructured project 2025-04-08 06:14:13 -04:00
Models.meta restructured project 2025-04-08 06:14:13 -04:00
Tools.meta restructured project 2025-04-08 06:14:13 -04:00
UnityMcpBridge.Editor.asmdef Fix: Add missing Runtime assembly and related files 2025-04-10 10:07:20 -07:00
UnityMcpBridge.Editor.asmdef.meta Fix: Add missing Runtime assembly and related files 2025-04-10 10:07:20 -07:00
UnityMcpBridge.cs feat: Improve GameObject serialization and add includeNonPublicSerialized flag 2025-04-10 08:12:20 -07:00
UnityMcpBridge.cs.meta restructured project 2025-04-08 06:14:13 -04:00
Windows.meta restructured project 2025-04-08 06:14:13 -04:00