@@ -310,14 +310,42 @@ private static object HandleScenes(ToolParams p)
310310 return new SuccessResponse ( $ "Build scenes ({ scenes . Length } ).", new { scenes } ) ;
311311 }
312312
313- // Write scene list
313+ // Handle string input: try JSON parse, then comma-separated
314+ if ( scenesRaw . Type == JTokenType . String )
315+ {
316+ string scenesStr = scenesRaw . ToString ( ) ;
317+ try { scenesRaw = JArray . Parse ( scenesStr ) ; }
318+ catch
319+ {
320+ // Treat as comma-separated paths
321+ var paths = scenesStr . Split ( ',' )
322+ . Select ( s => s . Trim ( ) )
323+ . Where ( s => ! string . IsNullOrEmpty ( s ) )
324+ . ToArray ( ) ;
325+ if ( paths . Length == 0 )
326+ return new ErrorResponse ( "'scenes' string contained no valid paths." ) ;
327+ var fromStr = paths . Select ( sp => new EditorBuildSettingsScene ( sp , true ) ) . ToArray ( ) ;
328+ EditorBuildSettings . scenes = fromStr ;
329+ return new SuccessResponse ( $ "Updated build scenes ({ fromStr . Length } ).", new
330+ {
331+ scenes = fromStr . Select ( s => new { path = s . path , enabled = s . enabled } ) . ToArray ( )
332+ } ) ;
333+ }
334+ }
335+
336+ // Write scene list — accepts array of strings or array of {path, enabled} objects
314337 var sceneArray = scenesRaw as JArray ;
315338 if ( sceneArray == null )
316- return new ErrorResponse ( "'scenes' must be an array of {path, enabled} objects." ) ;
339+ return new ErrorResponse ( "'scenes' must be an array of scene paths or {path, enabled} objects." ) ;
317340
318341 var newScenes = new List < EditorBuildSettingsScene > ( ) ;
319342 foreach ( var item in sceneArray )
320343 {
344+ if ( item . Type == JTokenType . String )
345+ {
346+ newScenes . Add ( new EditorBuildSettingsScene ( item . ToString ( ) , true ) ) ;
347+ continue ;
348+ }
321349 string path = item [ "path" ] ? . ToString ( ) ;
322350 if ( string . IsNullOrEmpty ( path ) )
323351 return new ErrorResponse ( "Each scene must have a 'path' field." ) ;
@@ -373,8 +401,9 @@ private static object HandleProfiles(ToolParams p)
373401 } ) ;
374402 }
375403
376- // Get profile details
377- var profileScenes = loadedProfile . GetScenesForBuild ( )
404+ // Get profile details — use .scenes (available since Unity 6000.0.0)
405+ // instead of .GetScenesForBuild() which was added in 6000.0.36
406+ var profileScenes = loadedProfile . scenes
378407 . Select ( s => s . path ) . ToArray ( ) ;
379408 return new SuccessResponse ( $ "Profile: { profilePath } ", new
380409 {
0 commit comments