|
|
@@ -707,13 +707,13 @@ public class GameMapEditor : EditorWindow
|
|
|
Tables allCfgData = new Tables(Loader);
|
|
|
List<SingleCreateEnemyConfig> cfgCreateEnemy = allCfgData.CfgCreateEnemy.DataList;
|
|
|
|
|
|
+ //导入关卡数据
|
|
|
if (mapIdx >= excelWorksheets.Count)
|
|
|
{
|
|
|
mapIdx = 0;
|
|
|
}
|
|
|
if (asset.maps.Count > excelWorksheets.Count)
|
|
|
{
|
|
|
-
|
|
|
for(int i = asset.maps.Count - 1; i>= excelWorksheets.Count; i--)
|
|
|
{
|
|
|
asset.RemoveMapAtIndex(i);
|
|
|
@@ -733,6 +733,28 @@ public class GameMapEditor : EditorWindow
|
|
|
mapSize_w = asset.maps[mapIdx].width;
|
|
|
mapSize_h = asset.maps[mapIdx].height;
|
|
|
|
|
|
+ //导入波次数据
|
|
|
+ currLayer = -1;
|
|
|
+ int mapId = -1;
|
|
|
+ String waveName = "";
|
|
|
+ for(int i = 0; i < cfgCreateEnemy.Count; i++)
|
|
|
+ {
|
|
|
+ if(cfgCreateEnemy[i].WaveName == "这一行不要动")
|
|
|
+ {
|
|
|
+ mapId++;
|
|
|
+ ArrayUtility.Clear(ref asset.maps[mapId].layers);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if(cfgCreateEnemy[i].WaveName != waveName)
|
|
|
+ {
|
|
|
+ waveName = cfgCreateEnemy[i].WaveName;
|
|
|
+ ArrayUtility.Add(ref asset.maps[mapId].layers, new GameMapLayer());
|
|
|
+ asset.maps[mapId].InitLayer(asset.maps[mapId].layers.Length);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ doRepaint = true;
|
|
|
Debug.Log("出怪表导入成功!");
|
|
|
}
|
|
|
|
|
|
@@ -796,18 +818,16 @@ public class GameMapEditor : EditorWindow
|
|
|
r.x = r.xMax - 28f; r.width = 25f; r.height = 15f;
|
|
|
|
|
|
GUI.enabled = currLayer >= 0;
|
|
|
+ GameMap gameMap = asset.maps[mapIdx];
|
|
|
if (GUI.Button(r, GC_rem, EditorStyles.miniButtonRight))
|
|
|
{
|
|
|
- Undo.RecordObject(asset, "Remove Layer");
|
|
|
- //foreach (GameMapTile tile in asset.tileAsset.tiles)
|
|
|
- //{
|
|
|
- // if (currLayer<tile.spawnTime.Count && tile.spawnTime[currLayer].curLayer == asset.maps[mapIdx].layers[currLayer].name)
|
|
|
- // {
|
|
|
- // tile.spawnTime.RemoveAt(currLayer);
|
|
|
- // }
|
|
|
|
|
|
- //}
|
|
|
- ArrayUtility.RemoveAt(ref asset.maps[mapIdx].layers, currLayer);
|
|
|
+ ExcelEditor.RemoveExcelRows(enemyExcelPath, gameMap.ident, (ws, row) =>
|
|
|
+ {
|
|
|
+ return ws.Cells[row, 2].Text == gameMap.layers[currLayer].name;
|
|
|
+ });
|
|
|
+ Undo.RecordObject(asset, "Remove Layer");
|
|
|
+ ArrayUtility.RemoveAt(ref gameMap.layers, currLayer);
|
|
|
|
|
|
EditorUtility.SetDirty(asset);
|
|
|
currLayer--;
|
|
|
@@ -817,14 +837,11 @@ public class GameMapEditor : EditorWindow
|
|
|
GUI.enabled = true;
|
|
|
if (GUI.Button(r, GC_add, EditorStyles.miniButtonLeft))
|
|
|
{
|
|
|
-
|
|
|
+ int length = gameMap.layers.Length + 1;
|
|
|
+ ExcelEditor.ModifyExcel(enemyExcelPath, gameMap.ident, $"B{length + 8}", length);
|
|
|
Undo.RecordObject(asset, "Add Layer");
|
|
|
- ArrayUtility.Add(ref asset.maps[mapIdx].layers, new GameMapLayer());
|
|
|
- asset.maps[mapIdx].InitLayer(asset.maps[mapIdx].layers.Length);
|
|
|
- //foreach (GameMapTile tile in asset.tileAsset.tiles)
|
|
|
- //{
|
|
|
- // tile.spawnTime.Add(new SpawnTimeList());
|
|
|
- //}
|
|
|
+ ArrayUtility.Add(ref gameMap.layers, new GameMapLayer());
|
|
|
+ gameMap.InitLayer(length);
|
|
|
EditorUtility.SetDirty(asset);
|
|
|
doRepaint = true;
|
|
|
}
|