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); } } } }