41 lines
1.2 KiB
C#
41 lines
1.2 KiB
C#
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);
|
|
}
|
|
}
|
|
}
|
|
} |