unity-mcp/MCPForUnity/Editor
dsarno f4d62e4da0
Fix material mesh instantiation warnings (#331)
* Editor: prevent material/mesh instantiation in edit mode

- GameObjectSerializer: in edit mode, normalize material/mesh access
  - material -> sharedMaterial
  - materials -> sharedMaterials
  - mesh -> sharedMesh
  - also guard materials/sharedMaterial/sharedMaterials property names
- Tests: add strong instanceID equality checks for Renderer/MeshFilter
  - prove no instantiation by shared instanceID before/after
  - cover multi-material, null cases; prune brittle presence/console tests
- Clean up and relax ManageGameObject tests to avoid false negatives

* Address review: simplify edit-mode guard; include protected/internal [SerializeField]; fix tests to destroy temp primitives and use dictionary access; strengthen instanceID assertions

* Fix resource leaks in test files

- ManageGameObjectTests.cs: Destroy temporary primitive GameObject after extracting sharedMesh
- MaterialMeshInstantiationTests.cs: Destroy instantiated uniqueMesh after test completion

These fixes prevent resource leaks in Unity test files by properly cleaning up temporary objects created during tests.

* Fix reflection bug in GetComponentData tests

- Replace incorrect reflection-based field access with proper dictionary key access
- GetComponentData() returns Dictionary<string, object> where 'properties' is a key, not a field
- Tests now properly access the properties dictionary and run assertions
- Fixes ineffective tests that were silently failing due to reflection returning null
2025-10-20 18:34:33 -07:00
..
Data Allow users to easily add tools in the Asset folder (#324) 2025-10-18 00:18:25 -04:00
Dependencies Update certain file GUIDs to prevent conflict 2025-10-19 23:09:38 -04:00
External Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
Helpers Fix material mesh instantiation warnings (#331) 2025-10-20 18:34:33 -07:00
Importers Allow users to easily add tools in the Asset folder (#324) 2025-10-18 00:18:25 -04:00
Models Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
Resources Add testing and move menu items to resources (#316) 2025-10-13 11:16:43 -04:00
Services Notify users when there's a new version (#329) 2025-10-18 20:42:18 -04:00
Setup New UI and work without MCP server embedded (#313) 2025-10-11 03:08:16 -04:00
Tools Add testing and move menu items to resources (#316) 2025-10-13 11:16:43 -04:00
Windows Notify users when there's a new version (#329) 2025-10-18 20:42:18 -04:00
AssemblyInfo.cs Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
AssemblyInfo.cs.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
Data.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
Dependencies.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
External.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
Helpers.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
Importers.meta Allow users to easily add tools in the Asset folder (#324) 2025-10-18 00:18:25 -04:00
MCPForUnity.Editor.asmdef Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
MCPForUnity.Editor.asmdef.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
MCPForUnityBridge.cs Add testing and move menu items to resources (#316) 2025-10-13 11:16:43 -04:00
MCPForUnityBridge.cs.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
Models.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
Resources.meta Add testing and move menu items to resources (#316) 2025-10-13 11:16:43 -04:00
Services.meta New UI and work without MCP server embedded (#313) 2025-10-11 03:08:16 -04:00
Setup.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
Tools.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
Windows.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00