Explorar o código

修复当前maps报错问题

wgl hai 7 meses
pai
achega
93a28c9b14

+ 2 - 1
ActionTowerDefense/Assets/GameLevelEditor/GameMap/CoreScripts/Editor/GameMapEdPopup.cs

@@ -67,9 +67,10 @@ public class GameMapEdPopup : PopupWindowContent
 			if (list.index >= 0 && list.index < Asset.maps.Count)
 			{
 				Undo.RecordObject(Asset, "Remove Game Map");
+				int key = list.index;
 				Asset.RemoveMapAtIndex(list.index);
 				contentRect = new Rect(0f, 18f, popupSz.x - 20f, Mathf.Max(popupSz.y - 18, EditorGUIUtility.singleLineHeight * Asset.maps.Count + 5));
-				OnMapSelected(-1);
+				OnMapSelected(key - 1);
 			}
 		}