Skip to content

Commit fe13260

Browse files
Update UnityMcpBridge/Editor/Tools/CommandRegistry.cs
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent 4314e2a commit fe13260

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

UnityMcpBridge/Editor/Tools/CommandRegistry.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,15 @@ private static void RegisterToolType(Type type)
8080
commandName = ToSnakeCase(type.Name);
8181
}
8282

83+
// Check for duplicate command names
84+
if (_handlers.ContainsKey(commandName))
85+
{
86+
McpLog.Warn(
87+
$"Duplicate command name '{commandName}' detected. " +
88+
$"Tool {type.Name} will override previously registered handler."
89+
);
90+
}
91+
8392
// Find HandleCommand method
8493
var method = type.GetMethod(
8594
"HandleCommand",

0 commit comments

Comments
 (0)