diff --git a/Assets/Scripts/Editor/MapSpawn/MapSpawnShowGizmos.cs b/Assets/Scripts/Editor/MapSpawn/MapSpawnShowGizmos.cs new file mode 100644 index 0000000..11f1213 --- /dev/null +++ b/Assets/Scripts/Editor/MapSpawn/MapSpawnShowGizmos.cs @@ -0,0 +1,41 @@ +using UnityEngine; +using System.Collections; +using UnityEditor; + +[CustomEditor(typeof(MapSpawnShow))] +public class MapSpawnShowGizmos : Editor +{ + GUIStyle _style = null; + + void OnSceneGUI() + { + + if (!((MapSpawnShow)target).mapMonsterCfg) + return; + MapMonsterCfg mapMonsterCfg = ((MapSpawnShow)target).mapMonsterCfg; + //if (_style == null) + { + _style = new GUIStyle("Command") + { + fontSize = 12, + alignment = TextAnchor.MiddleCenter, + imagePosition = ImagePosition.ImageAbove, + fontStyle = FontStyle.Normal, + fixedWidth = 100, + fixedHeight = 60 + }; + } + + float width = HandleUtility.GetHandleSize(Vector3.zero) * 0.5f; + + string Msg = ""; + foreach (var step in mapMonsterCfg.StepList) + { + foreach (var point in step.SpawnPoints) + { + Msg = $"刷怪点 \n {point.SpawnPointID}怪物ID:{point.MonsterCfgID} \n 数量 {point.MonsterCount} \n 坐标 {point.Pos}"; + Handles.Label(point.Pos, Msg, _style); + } + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Editor/MapSpawn/MapSpawnShowGizmos.cs.meta b/Assets/Scripts/Editor/MapSpawn/MapSpawnShowGizmos.cs.meta new file mode 100644 index 0000000..c4f70b2 --- /dev/null +++ b/Assets/Scripts/Editor/MapSpawn/MapSpawnShowGizmos.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: eed6600572a1ca24e92e60ee7614f567 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Editor/MapSpawn/MapSpawnTool.cs b/Assets/Scripts/Editor/MapSpawn/MapSpawnTool.cs index 4e93bd2..dab94e0 100644 --- a/Assets/Scripts/Editor/MapSpawn/MapSpawnTool.cs +++ b/Assets/Scripts/Editor/MapSpawn/MapSpawnTool.cs @@ -1,5 +1,6 @@ using UnityEditor; using UnityEngine; +using static UnityEngine.GraphicsBuffer; public class MapSpawnTool : EditorWindow { @@ -177,7 +178,7 @@ public class MapSpawnTool : EditorWindow EditorGUILayout.EndScrollView(); EditorGUILayout.EndVertical(); - + ShowSpanText(); } void OpenAssetPath() @@ -194,4 +195,12 @@ public class MapSpawnTool : EditorWindow + GUIStyle _style = null; + + void ShowSpanText() + { + + } + + } \ No newline at end of file diff --git a/Assets/Scripts/Main/Map/SpawnPoint/MapSpawnShow.cs b/Assets/Scripts/Main/Map/SpawnPoint/MapSpawnShow.cs index f194504..b2c2fac 100644 --- a/Assets/Scripts/Main/Map/SpawnPoint/MapSpawnShow.cs +++ b/Assets/Scripts/Main/Map/SpawnPoint/MapSpawnShow.cs @@ -15,7 +15,7 @@ public class MapSpawnShow : MonoBehaviour { Gizmos.color = Color.green; Gizmos.DrawCube(point.Pos, new Vector3(0.5f, 0.5f, 0.5f)); - Gizmos.DrawIcon(point.Pos, "myicon.png"); + //Gizmos.DrawIcon(point.Pos, "myicon.png"); } }