|
|
|
|
|
|
var sceneName = gameSceneTarget.sceneName; |
|
|
|
EditorGUI.BeginChangeCheck(); |
|
|
|
var selectedScene = sceneList.ToList().IndexOf(sceneName); |
|
|
|
selectedScene = EditorGUILayout.Popup("Scene", selectedScene, sceneList); |
|
|
|
if (selectedScene > -1) |
|
|
|
|
|
|
|
if (selectedScene < 0) |
|
|
|
if (EditorGUI.EndChangeCheck()) |
|
|
|
{ |
|
|
|
Undo.RecordObject(target, "Changed selected scene"); |
|
|
|
gameSceneTarget.sceneName = sceneList[selectedScene]; |
|
|
|
MarkAllDirty(); |
|
|
|
} |
|
|
|
EditorGUILayout.HelpBox(noScenesWarning, MessageType.Warning); |
|
|
|
else |
|
|
|
|
|
|
|
selectedScene = EditorGUILayout.Popup("Scene", selectedScene, sceneList); |
|
|
|
if (EditorGUI.EndChangeCheck()) |
|
|
|
EditorGUILayout.HelpBox(noScenesWarning, MessageType.Warning); |
|
|
|
Undo.RecordObject(target, "Changed selected scene"); |
|
|
|
gameSceneTarget.sceneName = sceneList[selectedScene]; |
|
|
|
MarkAllDirty(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|