|
|
@@ -667,14 +667,17 @@ public class GameMapEditor : EditorWindow
|
|
|
EditorGUILayout.BeginHorizontal();
|
|
|
{
|
|
|
EditorGUILayout.PrefixLabel("Size");
|
|
|
- mapSize_w = EditorGUILayout.IntField(mapSize_w, GUILayout.Width(35));
|
|
|
+ EditorGUI.BeginChangeCheck();
|
|
|
+ int newMapSize_w = EditorGUILayout.IntField(mapSize_w, GUILayout.Width(35));
|
|
|
GUILayout.Label("x");
|
|
|
- mapSize_h = EditorGUILayout.IntField(mapSize_h, GUILayout.Width(35));
|
|
|
+ int newMapSize_h = EditorGUILayout.IntField(mapSize_h, GUILayout.Width(35));
|
|
|
if (GUILayout.Button(GC_apply, EditorStyles.miniButtonRight))
|
|
|
{
|
|
|
- asset.maps[mapIdx].Resize(mapSize_w, mapSize_h);
|
|
|
+ asset.maps[mapIdx].Resize(newMapSize_w, newMapSize_h);
|
|
|
mapSize_w = asset.maps[mapIdx].width;
|
|
|
mapSize_h = asset.maps[mapIdx].height;
|
|
|
+ EditorUtility.SetDirty(asset);
|
|
|
+ AssetDatabase.SaveAssets();
|
|
|
}
|
|
|
GUILayout.FlexibleSpace();
|
|
|
}
|
|
|
@@ -701,7 +704,6 @@ public class GameMapEditor : EditorWindow
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- EditorUtility.SetDirty(asset);
|
|
|
EditorGUILayout.EndVertical();
|
|
|
}
|
|
|
|
|
|
@@ -965,16 +967,13 @@ public class GameMapEditor : EditorWindow
|
|
|
{
|
|
|
duration = EditorGUILayout.IntField("下一波时间", layer.duration);
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
|
|
|
+ List<SpawnTime> spawnTimes = layer.spawnTimes;
|
|
|
+ List<SpawnTime> newSpawnTimes = new List<SpawnTime>();
|
|
|
EditorGUILayout.BeginVertical("box");
|
|
|
{
|
|
|
EditorGUILayout.LabelField("Spawn Times", EditorStyles.boldLabel);
|
|
|
GUILayout.Space(5f);
|
|
|
-
|
|
|
- List<SpawnTime> spawnTimes = layer.spawnTimes;
|
|
|
- List<SpawnTime> newSpawnTimes = new List<SpawnTime>();
|
|
|
int[] grids = layer.grid;
|
|
|
for(int i = 0; i < grids.Length; i++)
|
|
|
{
|
|
|
@@ -1076,9 +1075,11 @@ public class GameMapEditor : EditorWindow
|
|
|
layer.buildingId = buildingId;
|
|
|
layer.buildingHp = buildingHp;
|
|
|
layer.isTowerWave = isTowerWave;
|
|
|
+ layer.spawnTimes = spawnTimes;
|
|
|
}
|
|
|
// 标记资源为脏数据,以便保存更改
|
|
|
EditorUtility.SetDirty(asset);
|
|
|
+ AssetDatabase.SaveAssets();
|
|
|
// 显示其他图层信息(根据需求扩展)
|
|
|
//EditorGUILayout.LabelField("Other Properties:");
|
|
|
//EditorGUILayout.LabelField($"Grid Size: {layer.gridSize}");
|