@@ -29,6 +29,7 @@ public class UnityMcpEditorWindow : EditorWindow
2929 private bool lastClientRegisteredOk ;
3030 private bool lastBridgeVerifiedOk ;
3131 private string pythonDirOverride = null ;
32+ private bool debugLogsEnabled ;
3233
3334 // Script validation settings
3435 private int validationLevelIndex = 1 ; // Default to Standard
@@ -56,6 +57,7 @@ private void OnEnable()
5657 // Refresh bridge status
5758 isUnityBridgeRunning = UnityMcpBridge . IsRunning ;
5859 autoRegisterEnabled = EditorPrefs . GetBool ( "UnityMCP.AutoRegisterEnabled" , true ) ;
60+ debugLogsEnabled = EditorPrefs . GetBool ( "UnityMCP.DebugLogs" , false ) ;
5961 foreach ( McpClient mcpClient in mcpClients . clients )
6062 {
6163 CheckMcpConfiguration ( mcpClient ) ;
@@ -148,14 +150,50 @@ private void OnGUI()
148150 // Header
149151 DrawHeader ( ) ;
150152
151- // Single-column streamlined layout
152- DrawServerStatusSection ( ) ;
153- EditorGUILayout . Space ( 6 ) ;
154- DrawBridgeSection ( ) ;
155- EditorGUILayout . Space ( 10 ) ;
156- DrawUnifiedClientConfiguration ( ) ;
153+ // Compute equal column widths for uniform layout
154+ float horizontalSpacing = 2f ;
155+ float outerPadding = 20f ; // approximate padding
156+ // Make columns a bit less wide for a tighter layout
157+ float computed = ( position . width - outerPadding - horizontalSpacing ) / 2f ;
158+ float colWidth = Mathf . Clamp ( computed , 220f , 340f ) ;
159+ // Use fixed heights per row so paired panels match exactly
160+ float topPanelHeight = 190f ;
161+ float bottomPanelHeight = 230f ;
162+
163+ // Top row: Server Status (left) and Unity Bridge (right)
164+ EditorGUILayout . BeginHorizontal ( ) ;
165+ {
166+ EditorGUILayout . BeginVertical ( GUILayout . Width ( colWidth ) , GUILayout . Height ( topPanelHeight ) ) ;
167+ DrawServerStatusSection ( ) ;
168+ EditorGUILayout . EndVertical ( ) ;
169+
170+ EditorGUILayout . Space ( horizontalSpacing ) ;
171+
172+ EditorGUILayout . BeginVertical ( GUILayout . Width ( colWidth ) , GUILayout . Height ( topPanelHeight ) ) ;
173+ DrawBridgeSection ( ) ;
174+ EditorGUILayout . EndVertical ( ) ;
175+ }
176+ EditorGUILayout . EndHorizontal ( ) ;
177+
157178 EditorGUILayout . Space ( 10 ) ;
158- DrawValidationSection ( ) ;
179+
180+ // Second row: MCP Client Configuration (left) and Script Validation (right)
181+ EditorGUILayout . BeginHorizontal ( ) ;
182+ {
183+ EditorGUILayout . BeginVertical ( GUILayout . Width ( colWidth ) , GUILayout . Height ( bottomPanelHeight ) ) ;
184+ DrawUnifiedClientConfiguration ( ) ;
185+ EditorGUILayout . EndVertical ( ) ;
186+
187+ EditorGUILayout . Space ( horizontalSpacing ) ;
188+
189+ EditorGUILayout . BeginVertical ( GUILayout . Width ( colWidth ) , GUILayout . Height ( bottomPanelHeight ) ) ;
190+ DrawValidationSection ( ) ;
191+ EditorGUILayout . EndVertical ( ) ;
192+ }
193+ EditorGUILayout . EndHorizontal ( ) ;
194+
195+ // Minimal bottom padding
196+ EditorGUILayout . Space ( 2 ) ;
159197
160198 EditorGUILayout . EndScrollView ( ) ;
161199 }
@@ -205,21 +243,12 @@ private void DrawServerStatusSection()
205243
206244 EditorGUILayout . Space ( 5 ) ;
207245
208- // Connection mode and Setup controls
246+ // Connection mode
209247 EditorGUILayout . BeginHorizontal ( ) ;
210-
211248 bool isAutoMode = UnityMcpBridge . IsAutoConnectMode ( ) ;
212249 GUIStyle modeStyle = new GUIStyle ( EditorStyles . miniLabel ) { fontSize = 11 } ;
213250 EditorGUILayout . LabelField ( $ "Mode: { ( isAutoMode ? "Auto" : "Standard" ) } ", modeStyle ) ;
214-
215251 GUILayout . FlexibleSpace ( ) ;
216-
217- // Bind to Clients button
218- if ( GUILayout . Button ( "Bind to Clients" , GUILayout . Width ( 140 ) , GUILayout . Height ( 24 ) ) )
219- {
220- RunSetupNow ( ) ;
221- }
222-
223252 EditorGUILayout . EndHorizontal ( ) ;
224253
225254 // Current ports display
@@ -231,6 +260,27 @@ private void DrawServerStatusSection()
231260 EditorGUILayout . LabelField ( $ "Ports: Unity { currentUnityPort } , MCP { mcpPort } ", portStyle ) ;
232261 EditorGUILayout . Space ( 5 ) ;
233262
263+ // Auto-Setup button below ports
264+ string setupButtonText = ( lastClientRegisteredOk && lastBridgeVerifiedOk ) ? "Connected ✓" : "Auto-Setup" ;
265+ if ( GUILayout . Button ( setupButtonText , GUILayout . Height ( 24 ) ) )
266+ {
267+ RunSetupNow ( ) ;
268+ }
269+ EditorGUILayout . Space ( 4 ) ;
270+
271+ // Debug logs toggle inside Server Status
272+ using ( new EditorGUILayout . HorizontalScope ( ) )
273+ {
274+ GUILayout . FlexibleSpace ( ) ;
275+ bool newDebug = EditorGUILayout . ToggleLeft ( "Show Debug Logs" , debugLogsEnabled , GUILayout . Width ( 150 ) ) ;
276+ if ( newDebug != debugLogsEnabled )
277+ {
278+ debugLogsEnabled = newDebug ;
279+ EditorPrefs . SetBool ( "UnityMCP.DebugLogs" , debugLogsEnabled ) ;
280+ }
281+ }
282+ EditorGUILayout . Space ( 2 ) ;
283+
234284 // Removed redundant inline badges to streamline UI
235285
236286 // Troubleshooting helpers
@@ -318,7 +368,18 @@ private void DrawValidationSection()
318368 EditorGUILayout . Space ( 8 ) ;
319369 string description = GetValidationLevelDescription ( validationLevelIndex ) ;
320370 EditorGUILayout . HelpBox ( description , MessageType . Info ) ;
321- EditorGUILayout . Space ( 5 ) ;
371+ EditorGUILayout . Space ( 4 ) ;
372+ // Inline debug logs toggle under Script Validation
373+ EditorGUILayout . BeginHorizontal ( ) ;
374+ GUILayout . FlexibleSpace ( ) ;
375+ bool newDebug = EditorGUILayout . ToggleLeft ( "Show Debug Logs" , debugLogsEnabled , GUILayout . Width ( 150 ) ) ;
376+ if ( newDebug != debugLogsEnabled )
377+ {
378+ debugLogsEnabled = newDebug ;
379+ EditorPrefs . SetBool ( "UnityMCP.DebugLogs" , debugLogsEnabled ) ;
380+ }
381+ EditorGUILayout . EndHorizontal ( ) ;
382+ EditorGUILayout . Space ( 2 ) ;
322383 EditorGUILayout . EndVertical ( ) ;
323384 }
324385
@@ -870,7 +931,10 @@ private string FindPackagePythonDirectory()
870931 {
871932 if ( Directory . Exists ( devPath ) && File . Exists ( Path . Combine ( devPath , "server.py" ) ) )
872933 {
873- UnityEngine . Debug . Log ( $ "Currently in development mode. Package: { devPath } ") ;
934+ if ( debugLogsEnabled )
935+ {
936+ UnityEngine . Debug . Log ( $ "Currently in development mode. Package: { devPath } ") ;
937+ }
874938 return devPath ;
875939 }
876940 }
@@ -931,7 +995,10 @@ private string FindPackagePythonDirectory()
931995 }
932996
933997 // If still not found, return the placeholder path
934- UnityEngine . Debug . LogWarning ( "Could not find Python directory, using placeholder path" ) ;
998+ if ( debugLogsEnabled )
999+ {
1000+ UnityEngine . Debug . LogWarning ( "Could not find Python directory, using placeholder path" ) ;
1001+ }
9351002 }
9361003 catch ( Exception e )
9371004 {
@@ -1319,7 +1386,10 @@ private void RegisterWithClaudeCode(string pythonDir)
13191386 }
13201387 else if ( ! string . IsNullOrEmpty ( errors ) )
13211388 {
1322- UnityEngine . Debug . LogWarning ( $ "Claude MCP errors: { errors } ") ;
1389+ if ( debugLogsEnabled )
1390+ {
1391+ UnityEngine . Debug . LogWarning ( $ "Claude MCP errors: { errors } ") ;
1392+ }
13231393 }
13241394 }
13251395 catch ( Exception e )
@@ -1806,7 +1876,10 @@ private void CheckClaudeCodeConfiguration(McpClient mcpClient)
18061876 ? mcpClient . windowsConfigPath
18071877 : mcpClient . linuxConfigPath ;
18081878
1809- UnityEngine . Debug . Log ( $ "Checking Claude config at: { configPath } ") ;
1879+ if ( debugLogsEnabled )
1880+ {
1881+ UnityEngine . Debug . Log ( $ "Checking Claude config at: { configPath } ") ;
1882+ }
18101883
18111884 if ( ! File . Exists ( configPath ) )
18121885 {
0 commit comments