@@ -51,7 +51,7 @@ protected override void OnGUISafe(Rect position, SerializedProperty property, GU
5151 return ;
5252 }
5353
54- var sceneData = SceneData . GetSceneData ( sceneProperty ) ;
54+ var sceneData = SceneData . GetSceneDataFromIndex ( property ) ;
5555 var spacing = EditorGUIUtility . standardVerticalSpacing ;
5656 position . y += EditorGUIUtility . singleLineHeight + spacing ;
5757 if ( sceneData . inBuild )
@@ -82,10 +82,21 @@ private struct SceneData
8282 {
8383 public int index ;
8484 public bool enabled ;
85- public GUID guid ;
8685 public bool inBuild ;
8786
88- public static SceneData GetSceneData ( SerializedProperty property )
87+ public static SceneData GetSceneDataFromIndex ( SerializedProperty property )
88+ {
89+ var indexProperty = property . FindPropertyRelative ( "buildIndex" ) ;
90+ var index = indexProperty . intValue ;
91+ return new SceneData ( )
92+ {
93+ index = index ,
94+ enabled = index != - 1 ,
95+ inBuild = index != - 1
96+ } ;
97+ }
98+
99+ public static SceneData GetSceneDataFromScene ( SerializedProperty property )
89100 {
90101 var sceneData = new SceneData ( )
91102 {
@@ -101,7 +112,7 @@ public static SceneData GetSceneData(SerializedProperty property)
101112 for ( var i = 0 ; i < EditorBuildSettings . scenes . Length ; i ++ )
102113 {
103114 var sceneSettings = EditorBuildSettings . scenes [ i ] ;
104- var isEnabled = sceneSettings . enabled ;
115+ var isEnabled = sceneSettings . enabled && ! string . IsNullOrEmpty ( sceneSettings . path ) ;
105116 if ( isEnabled )
106117 {
107118 sceneIndex ++ ;
@@ -112,7 +123,6 @@ public static SceneData GetSceneData(SerializedProperty property)
112123 {
113124 sceneData . index = isEnabled ? sceneIndex : - 1 ;
114125 sceneData . enabled = isEnabled ;
115- sceneData . guid = guid ;
116126 sceneData . inBuild = true ;
117127 break ;
118128 }
0 commit comments