|
@@ -5,6 +5,7 @@ using UnityEngine;
|
|
|
using UnityEditor;
|
|
using UnityEditor;
|
|
|
using System.Linq;
|
|
using System.Linq;
|
|
|
|
|
|
|
|
|
|
+
|
|
|
public class GameMapEditor : EditorWindow
|
|
public class GameMapEditor : EditorWindow
|
|
|
{
|
|
{
|
|
|
// ----------------------------------------------------------------------------------------------------------------
|
|
// ----------------------------------------------------------------------------------------------------------------
|
|
@@ -111,6 +112,7 @@ public class GameMapEditor : EditorWindow
|
|
|
private StyleDefs _styles = null;
|
|
private StyleDefs _styles = null;
|
|
|
private StyleDefs Styles { get { return _styles ?? (_styles = new StyleDefs()); } }
|
|
private StyleDefs Styles { get { return _styles ?? (_styles = new StyleDefs()); } }
|
|
|
|
|
|
|
|
|
|
+ private static readonly GUIContent GC_ExcelReload = new GUIContent("-reload-");
|
|
|
private static readonly GUIContent GC_MapSelect = new GUIContent("-select-");
|
|
private static readonly GUIContent GC_MapSelect = new GUIContent("-select-");
|
|
|
private static readonly GUIContent GC_EditorHead = new GUIContent("Editor");
|
|
private static readonly GUIContent GC_EditorHead = new GUIContent("Editor");
|
|
|
private static readonly GUIContent GC_AssetHead = new GUIContent("Asset");
|
|
private static readonly GUIContent GC_AssetHead = new GUIContent("Asset");
|
|
@@ -517,13 +519,13 @@ public class GameMapEditor : EditorWindow
|
|
|
gridColor = EditorGUILayout.ColorField(GC_GridCol, gridColor);
|
|
gridColor = EditorGUILayout.ColorField(GC_GridCol, gridColor);
|
|
|
if (EditorGUI.EndChangeCheck()) EditorPrefs_SetColor("plyGameMapEd.gridColor", gridColor);
|
|
if (EditorGUI.EndChangeCheck()) EditorPrefs_SetColor("plyGameMapEd.gridColor", gridColor);
|
|
|
|
|
|
|
|
- EditorGUI.BeginChangeCheck();
|
|
|
|
|
- outsideMapIsSolid = EditorGUILayout.Toggle(GC_Solid, outsideMapIsSolid);
|
|
|
|
|
- if (EditorGUI.EndChangeCheck()) EditorPrefs.SetBool("plyGameMapEd.outsideMapIsSolid", outsideMapIsSolid);
|
|
|
|
|
|
|
+ //EditorGUI.BeginChangeCheck();
|
|
|
|
|
+ //outsideMapIsSolid = EditorGUILayout.Toggle(GC_Solid, outsideMapIsSolid);
|
|
|
|
|
+ //if (EditorGUI.EndChangeCheck()) EditorPrefs.SetBool("plyGameMapEd.outsideMapIsSolid", outsideMapIsSolid);
|
|
|
|
|
|
|
|
- EditorGUI.BeginChangeCheck();
|
|
|
|
|
- refTileSz = EditorGUILayout.FloatField(GC_AutoSz, refTileSz);
|
|
|
|
|
- if (EditorGUI.EndChangeCheck()) EditorPrefs.SetFloat("plyGameMapEd.refTileSz", refTileSz);
|
|
|
|
|
|
|
+ //EditorGUI.BeginChangeCheck();
|
|
|
|
|
+ //refTileSz = EditorGUILayout.FloatField(GC_AutoSz, refTileSz);
|
|
|
|
|
+ //if (EditorGUI.EndChangeCheck()) EditorPrefs.SetFloat("plyGameMapEd.refTileSz", refTileSz);
|
|
|
|
|
|
|
|
EditorGUILayout.Space();
|
|
EditorGUILayout.Space();
|
|
|
}
|
|
}
|
|
@@ -615,9 +617,18 @@ public class GameMapEditor : EditorWindow
|
|
|
{
|
|
{
|
|
|
// map selection button
|
|
// map selection button
|
|
|
r.height = EditorGUIUtility.singleLineHeight;
|
|
r.height = EditorGUIUtility.singleLineHeight;
|
|
|
- r.x = r.xMax - 103f; r.width = 100f; r.height = 15f;
|
|
|
|
|
|
|
+ r.x = r.xMax - 200f; r.width = 100f; r.height = 15f;
|
|
|
|
|
+ if (GUI.Button(r, GC_ExcelReload))
|
|
|
|
|
+ {
|
|
|
|
|
+ List<string> excelWorksheets = ExcelEditor.ReadExcelSheetsInfo("Luban/Config/Datas/出怪表.xlsx");
|
|
|
|
|
+ for (int i = 0; i < excelWorksheets.Count; i++)
|
|
|
|
|
+ {
|
|
|
|
|
+ asset.maps[i].ident = excelWorksheets[i];
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ r.x = r.xMax; r.width = 100f; r.height = 15f;
|
|
|
if (GUI.Button(r, GC_MapSelect))
|
|
if (GUI.Button(r, GC_MapSelect))
|
|
|
- {
|
|
|
|
|
|
|
+ {
|
|
|
mapsPopup.Asset = asset;
|
|
mapsPopup.Asset = asset;
|
|
|
mapsPopup.OnMapSelected = OnMapSelected;
|
|
mapsPopup.OnMapSelected = OnMapSelected;
|
|
|
PopupWindow.Show(r, mapsPopup);
|
|
PopupWindow.Show(r, mapsPopup);
|
|
@@ -684,6 +695,8 @@ public class GameMapEditor : EditorWindow
|
|
|
EditorGUILayout.EndVertical();
|
|
EditorGUILayout.EndVertical();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
private void OnMapSelected(int idx)
|
|
private void OnMapSelected(int idx)
|
|
|
{
|
|
{
|
|
|
if (mapIdx == idx) return;
|
|
if (mapIdx == idx) return;
|