diff --git a/UnityMcpBridge/Editor/Tools/ExecuteMenuItem.cs b/UnityMcpBridge/Editor/Tools/ExecuteMenuItem.cs index b5de165..18b4f04 100644 --- a/UnityMcpBridge/Editor/Tools/ExecuteMenuItem.cs +++ b/UnityMcpBridge/Editor/Tools/ExecuteMenuItem.cs @@ -66,13 +66,15 @@ namespace UnityMcpBridge.Editor.Tools /// private static object ExecuteItem(JObject @params) { - string menuPath = @params["menu_path"]?.ToString(); + // Try both naming conventions: snake_case and camelCase + string menuPath = @params["menu_path"]?.ToString() ?? @params["menuPath"]?.ToString(); + // string alias = @params["alias"]?.ToString(); // TODO: Implement alias mapping based on refactor plan requirements. // JObject parameters = @params["parameters"] as JObject; // TODO: Investigate parameter passing (often not directly supported by ExecuteMenuItem). if (string.IsNullOrWhiteSpace(menuPath)) { - return Response.Error("Required parameter 'menu_path' is missing or empty."); + return Response.Error("Required parameter 'menu_path' or 'menuPath' is missing or empty."); } // Validate against blacklist diff --git a/UnityMcpBridge/Editor/Tools/ManageAsset.cs b/UnityMcpBridge/Editor/Tools/ManageAsset.cs index 7a0dad7..84af347 100644 --- a/UnityMcpBridge/Editor/Tools/ManageAsset.cs +++ b/UnityMcpBridge/Editor/Tools/ManageAsset.cs @@ -891,6 +891,29 @@ namespace UnityMcpBridge.Editor.Tools ); } } + } else if (properties["_Color"] is JArray colorArr) //Current Prevention for systems that use _Color instead of color + { + try { + if (colorArr.Count >= 3) + { + Color newColor = new Color( + colorArr[0].ToObject(), + colorArr[1].ToObject(), + colorArr[2].ToObject(), + colorArr.Count > 3 ? colorArr[3].ToObject() : 1.0f + ); + if (mat.HasProperty(propName) && mat.GetColor(propName) != newColor) + { + mat.SetColor(propName, newColor); + modified = true; + } + } + } + catch (Exception ex) { + Debug.LogWarning( + $"Error parsing color property '{propName}': {ex.Message}" + ); + } } // Example: Set float property if (properties["float"] is JObject floatProps)