@@ -10,10 +10,10 @@ public class SerializedSceneDrawer : PropertyDrawerBase
1010 private bool HasSceneDetails ( SerializedProperty property )
1111 {
1212 var sceneProperty = property . FindPropertyRelative ( "sceneReference" ) ;
13- return attribute != null && sceneProperty . objectReferenceValue ;
13+ return attribute != null && attribute is SceneDetailsAttribute && sceneProperty . objectReferenceValue ;
1414 }
1515
16- private void DrawIncludedSceneDetails ( Rect position , SceneData sceneData )
16+ private void DrawSceneDetails ( Rect position , SceneData sceneData )
1717 {
1818 EditorGUI . BeginDisabledGroup ( true ) ;
1919 var spacing = EditorGUIUtility . standardVerticalSpacing ;
@@ -23,19 +23,6 @@ private void DrawIncludedSceneDetails(Rect position, SceneData sceneData)
2323 EditorGUI . EndDisabledGroup ( ) ;
2424 }
2525
26- private void DrawRejectedSceneDetails ( Rect position , SceneData sceneData )
27- {
28- EditorGUI . BeginDisabledGroup ( true ) ;
29- var spacing = EditorGUIUtility . standardVerticalSpacing ;
30- EditorGUI . LabelField ( position , Style . notInBuildContent ) ;
31- position . y += EditorGUIUtility . singleLineHeight + spacing ;
32- EditorGUI . EndDisabledGroup ( ) ;
33- if ( GUI . Button ( position , Style . showDetailsContent ) )
34- {
35- OpenBuildSettings ( ) ;
36- }
37- }
38-
3926 private void OpenBuildSettings ( )
4027 {
4128 EditorWindow . GetWindow ( typeof ( BuildPlayerWindow ) ) ;
@@ -69,11 +56,18 @@ protected override void OnGUISafe(Rect position, SerializedProperty property, GU
6956 position . y += EditorGUIUtility . singleLineHeight + spacing ;
7057 if ( sceneData . inBuild )
7158 {
72- DrawIncludedSceneDetails ( position , sceneData ) ;
59+ DrawSceneDetails ( position , sceneData ) ;
7360 }
7461 else
7562 {
76- DrawRejectedSceneDetails ( position , sceneData ) ;
63+ EditorGUI . BeginDisabledGroup ( true ) ;
64+ EditorGUI . LabelField ( position , Style . notInBuildContent ) ;
65+ position . y += EditorGUIUtility . singleLineHeight + spacing ;
66+ EditorGUI . EndDisabledGroup ( ) ;
67+ if ( GUI . Button ( position , Style . showDetailsContent ) )
68+ {
69+ OpenBuildSettings ( ) ;
70+ }
7771 }
7872 }
7973
0 commit comments