|
@@ -713,14 +713,14 @@ public class GameMapEditor : EditorWindow
|
|
|
if (GUI.Button(r, GC_rem, EditorStyles.miniButtonRight))
|
|
if (GUI.Button(r, GC_rem, EditorStyles.miniButtonRight))
|
|
|
{
|
|
{
|
|
|
Undo.RecordObject(asset, "Remove Layer");
|
|
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);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ //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);
|
|
ArrayUtility.RemoveAt(ref asset.maps[mapIdx].layers, currLayer);
|
|
|
|
|
|
|
|
EditorUtility.SetDirty(asset);
|
|
EditorUtility.SetDirty(asset);
|
|
@@ -735,10 +735,10 @@ public class GameMapEditor : EditorWindow
|
|
|
Undo.RecordObject(asset, "Add Layer");
|
|
Undo.RecordObject(asset, "Add Layer");
|
|
|
ArrayUtility.Add(ref asset.maps[mapIdx].layers, new GameMapLayer());
|
|
ArrayUtility.Add(ref asset.maps[mapIdx].layers, new GameMapLayer());
|
|
|
asset.maps[mapIdx].InitLayer(asset.maps[mapIdx].layers.Length);
|
|
asset.maps[mapIdx].InitLayer(asset.maps[mapIdx].layers.Length);
|
|
|
- foreach (GameMapTile tile in asset.tileAsset.tiles)
|
|
|
|
|
- {
|
|
|
|
|
- tile.spawnTime.Add(new SpawnTimeList());
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ //foreach (GameMapTile tile in asset.tileAsset.tiles)
|
|
|
|
|
+ //{
|
|
|
|
|
+ // tile.spawnTime.Add(new SpawnTimeList());
|
|
|
|
|
+ //}
|
|
|
EditorUtility.SetDirty(asset);
|
|
EditorUtility.SetDirty(asset);
|
|
|
doRepaint = true;
|
|
doRepaint = true;
|
|
|
}
|
|
}
|
|
@@ -833,21 +833,45 @@ public class GameMapEditor : EditorWindow
|
|
|
|
|
|
|
|
// 显示并编辑图层名称
|
|
// 显示并编辑图层名称
|
|
|
EditorGUI.BeginChangeCheck();
|
|
EditorGUI.BeginChangeCheck();
|
|
|
- string addName = EditorGUILayout.TextField("Name", layer.name);
|
|
|
|
|
|
|
+ string addName = EditorGUILayout.TextField("Wave Name", layer.name);
|
|
|
|
|
|
|
|
- int duration = EditorGUILayout.IntField("Duration", layer.duration);
|
|
|
|
|
|
|
+ int duration = EditorGUILayout.IntField("Next Wave", layer.duration);
|
|
|
float addHp = EditorGUILayout.FloatField("Hp", layer.Hp);
|
|
float addHp = EditorGUILayout.FloatField("Hp", layer.Hp);
|
|
|
float addMoveSpeed = EditorGUILayout.FloatField("MoveSpeed", layer.moveSpeed);
|
|
float addMoveSpeed = EditorGUILayout.FloatField("MoveSpeed", layer.moveSpeed);
|
|
|
float addAttack = EditorGUILayout.FloatField("Attack", layer.attack);
|
|
float addAttack = EditorGUILayout.FloatField("Attack", layer.attack);
|
|
|
- if (EditorGUI.EndChangeCheck())
|
|
|
|
|
|
|
+
|
|
|
|
|
+ EditorGUILayout.BeginVertical("box");
|
|
|
{
|
|
{
|
|
|
- Undo.RecordObject(asset, "Change Layer Information");
|
|
|
|
|
- foreach (GameMapTile tile in asset.tileAsset.tiles)
|
|
|
|
|
|
|
+ EditorGUILayout.LabelField("Spawn Times", EditorStyles.boldLabel);
|
|
|
|
|
+ GUILayout.Space(5f);
|
|
|
|
|
+ for (int i = 0; i < layer.spawnTimes.Count; i++)
|
|
|
{
|
|
{
|
|
|
- SpawnTimeList spawnTimeList = tile.spawnTime[currLayer];
|
|
|
|
|
- spawnTimeList.curLayer = addName;
|
|
|
|
|
- tile.spawnTime[currLayer] = spawnTimeList;
|
|
|
|
|
|
|
+ SpawnTime spawnTime = layer.spawnTimes[i];
|
|
|
|
|
+ spawnTime.name = EditorGUILayout.TextField("Tile Name", layer.spawnTimes[i].name);
|
|
|
|
|
+ spawnTime.startTime = EditorGUILayout.IntField("Start Time", layer.spawnTimes[i].startTime);
|
|
|
|
|
+ spawnTime.endTime = EditorGUILayout.IntField("End Time", layer.spawnTimes[i].endTime);
|
|
|
|
|
+ spawnTime.num = EditorGUILayout.IntField("Number", layer.spawnTimes[i].num);
|
|
|
|
|
+ layer.spawnTimes[i] = spawnTime;
|
|
|
|
|
+
|
|
|
|
|
+ if (GUILayout.Button("Remove"))
|
|
|
|
|
+ {
|
|
|
|
|
+ layer.spawnTimes.RemoveAt(i);
|
|
|
|
|
+ i--;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
+ }
|
|
|
|
|
+ EditorGUILayout.EndVertical();
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ if (EditorGUI.EndChangeCheck())
|
|
|
|
|
+ {
|
|
|
|
|
+ Undo.RecordObject(asset, "Change Layer Information");
|
|
|
|
|
+ //foreach (GameMapTile tile in asset.tileAsset.tiles)
|
|
|
|
|
+ //{
|
|
|
|
|
+ // SpawnTimeList spawnTimeList = tile.spawnTime[currLayer];
|
|
|
|
|
+ // spawnTimeList.curLayer = addName;
|
|
|
|
|
+ // tile.spawnTime[currLayer] = spawnTimeList;
|
|
|
|
|
+ //}
|
|
|
layer.name = addName;
|
|
layer.name = addName;
|
|
|
layer.duration = duration;
|
|
layer.duration = duration;
|
|
|
layer.Hp = addHp;
|
|
layer.Hp = addHp;
|