wgl 6 tháng trước cách đây
mục cha
commit
bc7f0430a5

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

@@ -60,37 +60,37 @@ public class GameMapEdPopup : PopupWindowContent
 		}
 
 		GUI.Label(r, GC_Head, EditorStyles.boldLabel);
-		r.x = r.xMax - 25; r.width = 25;
-		GUI.enabled = list.index >= 0;
-		if (GUI.Button(r, GC_Rem, EditorStyles.miniButtonRight))
-		{
-			if (list.index >= 0 && list.index < Asset.maps.Count)
-			{
-				Undo.RecordObject(Asset, "Remove Game Map");
-				int key = list.index;
-				Asset.RemoveMapAtIndex(list.index);
-				ChangeContentRect();
-				if(key == 0)
-                {
-					OnMapSelected(0);
-                }
-                else
-                {
-					OnMapSelected(key - 1);
-				}
+		//r.x = r.xMax - 25; r.width = 25;
+		//GUI.enabled = list.index >= 0;
+		//if (GUI.Button(r, GC_Rem, EditorStyles.miniButtonRight))
+		//{
+		//	if (list.index >= 0 && list.index < Asset.maps.Count)
+		//	{
+		//		Undo.RecordObject(Asset, "Remove Game Map");
+		//		int key = list.index;
+		//		Asset.RemoveMapAtIndex(list.index);
+		//		ChangeContentRect();
+		//		if(key == 0)
+  //              {
+		//			OnMapSelected(0);
+  //              }
+  //              else
+  //              {
+		//			OnMapSelected(key - 1);
+		//		}
 				
-			}
-		}
-
-		GUI.enabled = true;
-		r.x -= 25;
-		if (GUI.Button(r, GC_Add, EditorStyles.miniButtonLeft))
-		{
-			Undo.RecordObject(Asset, "Add Game Map");
-			Asset.AddMap();
-			ChangeContentRect();
-			OnMapSelected(Asset.maps.Count - 1);
-		}
+		//	}
+		//}
+
+		//GUI.enabled = true;
+		//r.x -= 25;
+		//if (GUI.Button(r, GC_Add, EditorStyles.miniButtonLeft))
+		//{
+		//	Undo.RecordObject(Asset, "Add Game Map");
+		//	Asset.AddMap();
+		//	ChangeContentRect();
+		//	OnMapSelected(Asset.maps.Count - 1);
+		//}
 	}
 
 	private void DrawElement(Rect r, int index, bool isActive, bool isFocused)
@@ -110,7 +110,7 @@ public class GameMapEdPopup : PopupWindowContent
 
 	public void ChangeMapSelected(int id)
     {
-		OnMapSelected(id);
+		OnMapSelected(0);
 	}
 
 	// ----------------------------------------------------------------------------------------------------------------

+ 3 - 2
ActionTowerDefense/Assets/GameLevelEditor/GameMap/CoreScripts/Editor/GameMapEditor.cs

@@ -709,7 +709,7 @@ public class GameMapEditor : EditorWindow
 
         if (mapIdx >= excelWorksheets.Count)
         {
-			mapsPopup.ChangeMapSelected(excelWorksheets.Count - 1);
+			mapIdx = 0;
 		}
 		if (asset.maps.Count > excelWorksheets.Count)
         {
@@ -730,9 +730,10 @@ public class GameMapEditor : EditorWindow
 			int.TryParse(ExcelEditor.GetCellData(path, excelWorksheets[i], "D6"), out int height);
 			asset.maps[i].Resize(width, height);
 		}
-		mapsPopup.ChangeContentRect();
 		mapSize_w = asset.maps[mapIdx].width;
 		mapSize_h = asset.maps[mapIdx].height;
+
+		Debug.Log("出怪表导入成功!");
 	}
 
 

BIN
ActionTowerDefense/Luban/Config/Datas/出怪表.xlsx