Skip to content

Commit 70e6840

Browse files
committed
* Fixed: couldn't select None scene (thanks to harrisonmg)
1 parent 0437d49 commit 70e6840

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Assets/DevLocker/Utils/SceneReference.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ public override void OnGUI(Rect position, SerializedProperty property, GUIConten
193193
buildSettingsPos.width = buildSettingsWidth;
194194

195195
var sceneAssetProperty = property.FindPropertyRelative("m_SceneAsset");
196+
bool hadReference = sceneAssetProperty.objectReferenceValue != null;
196197

197198
EditorGUI.PropertyField(assetPos, sceneAssetProperty, new GUIContent());
198199

@@ -204,6 +205,8 @@ public override void OnGUI(Rect position, SerializedProperty property, GUIConten
204205
if (AssetDatabase.TryGetGUIDAndLocalFileIdentifier(sceneAssetProperty.objectReferenceValue, out guid, out localId)) {
205206
indexInSettings = Array.FindIndex(EditorBuildSettings.scenes, s => s.guid.ToString() == guid);
206207
}
208+
} else if (hadReference) {
209+
property.FindPropertyRelative("m_ScenePath").stringValue = string.Empty;
207210
}
208211

209212
GUIContent settingsContent = indexInSettings != -1

0 commit comments

Comments
 (0)