完善刷怪点Scene显示
This commit is contained in:
parent
78449200c3
commit
6952473feb
41
Assets/Scripts/Editor/MapSpawn/MapSpawnShowGizmos.cs
Normal file
41
Assets/Scripts/Editor/MapSpawn/MapSpawnShowGizmos.cs
Normal file
@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
11
Assets/Scripts/Editor/MapSpawn/MapSpawnShowGizmos.cs.meta
Normal file
11
Assets/Scripts/Editor/MapSpawn/MapSpawnShowGizmos.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: eed6600572a1ca24e92e60ee7614f567
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@ -1,5 +1,6 @@
|
|||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using static UnityEngine.GraphicsBuffer;
|
||||||
|
|
||||||
public class MapSpawnTool : EditorWindow
|
public class MapSpawnTool : EditorWindow
|
||||||
{
|
{
|
||||||
@ -177,7 +178,7 @@ public class MapSpawnTool : EditorWindow
|
|||||||
|
|
||||||
EditorGUILayout.EndScrollView();
|
EditorGUILayout.EndScrollView();
|
||||||
EditorGUILayout.EndVertical();
|
EditorGUILayout.EndVertical();
|
||||||
|
ShowSpanText();
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenAssetPath()
|
void OpenAssetPath()
|
||||||
@ -194,4 +195,12 @@ public class MapSpawnTool : EditorWindow
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
GUIStyle _style = null;
|
||||||
|
|
||||||
|
void ShowSpanText()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -15,7 +15,7 @@ public class MapSpawnShow : MonoBehaviour
|
|||||||
{
|
{
|
||||||
Gizmos.color = Color.green;
|
Gizmos.color = Color.green;
|
||||||
Gizmos.DrawCube(point.Pos, new Vector3(0.5f, 0.5f, 0.5f));
|
Gizmos.DrawCube(point.Pos, new Vector3(0.5f, 0.5f, 0.5f));
|
||||||
Gizmos.DrawIcon(point.Pos, "myicon.png");
|
//Gizmos.DrawIcon(point.Pos, "myicon.png");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user