Переглянути джерело

关卡编辑器Id值与数组索引对应

wgl 7 місяців тому
батько
коміт
42ec4b1306

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

@@ -637,7 +637,7 @@ public class GameMapEditor : EditorWindow
 					EditorGUILayout.BeginHorizontal();
 					{
 						EditorGUILayout.PrefixLabel("Ident");
-						GUILayout.Label(asset.maps[mapIdx].id.ToString() + " => " + asset.maps[mapIdx].ident);
+						GUILayout.Label(mapIdx.ToString() + " => " + asset.maps[mapIdx].ident);
 						if (GUILayout.Button(GC_rename, EditorStyles.miniButtonRight)) GameMapTextEd.ShowEd("Rename map", "Enter a unique name", asset.maps[mapIdx].ident, OnRenameMap);
 						GUILayout.FlexibleSpace();
 					}

+ 1 - 1
ActionTowerDefense/Assets/GameLevelEditor/GameMap/CoreScripts/GameMap.cs

@@ -10,7 +10,7 @@ using UnityEngine;
 public class GameMap
 {
 	/// <summary> a unique identifier for the map </summary>
-	public int id;
+	//public int id;
 
 	/// <summary> a unique name by which map can be identified </summary>
 	public string ident;

+ 1 - 1
ActionTowerDefense/Assets/GameLevelEditor/GameMap/CoreScripts/GameMapsAsset.cs

@@ -25,7 +25,7 @@ public class GameMapsAsset : ScriptableObject
 	/// <summary> Add a new map. Mainly for use by the map editor. </summary>
 	public void AddMap()
 	{
-		GameMap m = new GameMap() { id = nextMapId, ident = "Map " + nextMapId };
+		GameMap m = new GameMap() { ident = "Map " + nextMapId };
 		m.SetSize(10, 10);
 		nextMapId++;
 		maps.Add(m);