File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
com.unity.netcode.gameobjects/Editor Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -104,8 +104,15 @@ private static void ScenesInBuildActiveSceneCheck()
104104 $ "to synchronize to this scene unless it is added to the scenes in build list.\n \n Would you like to add it now?",
105105 "Yes" , "No - Continue" ) )
106106 {
107- scenesList . Add ( new EditorBuildSettingsScene ( activeScene . path , true ) ) ;
108- EditorBuildSettings . scenes = scenesList . ToArray ( ) ;
107+ // Double double check that the EditorBuildSettings.scenes has not changed already before adding
108+ // this scene to the array (Parrel Sync issue)
109+ scenesList = EditorBuildSettings . scenes . ToList ( ) ;
110+ isSceneInBuildSettings = scenesList . Count ( ( c ) => c . path == activeScene . path ) == 1 ;
111+ if ( ! isSceneInBuildSettings )
112+ {
113+ scenesList . Add ( new EditorBuildSettingsScene ( activeScene . path , true ) ) ;
114+ EditorBuildSettings . scenes = scenesList . ToArray ( ) ;
115+ }
109116 }
110117 }
111118 }
You can’t perform that action at this time.
0 commit comments