Bläddra i källkod

删掉第一个关卡会报错

wgl 6 månader sedan
förälder
incheckning
8709b0838e

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

@@ -70,7 +70,15 @@ public class GameMapEdPopup : PopupWindowContent
 				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(key - 1);
+				if(key == 0)
+                {
+					OnMapSelected(0);
+                }
+                else
+                {
+					OnMapSelected(key - 1);
+				}
+				
 			}
 		}