/// <summary>
/// typeof(PoolTest = 需要显示面板的类)
/// </summary>
[CustomEditor(typeof(PoolTest), true)]
public class PoolAnalyze_ClassObjectPoolEditor : Editor
{
public override void OnInspectorGUI()
{
base.OnInspectorGUI();
GUILayout.BeginHorizontal("box");
GUILayout.Label("类名");
GUILayout.Label("池中数量", GUILayout.Width(50));
GUILayout.Label("常驻数量", GUILayout.Width(50));
GUILayout.EndHorizontal();
if (GameEntry.Pool.ClassObjectPool != null)
{
foreach (var item in GameEntry.Pool.ClassObjectPool.InspectorDic)
{
GUILayout.BeginHorizontal("box");
GUILayout.Label(item.Key);
GUILayout.Label(item.Value.ToString(), GUILayout.Width(50));
GUILayout.Label("0", GUILayout.Width(50));
GUILayout.EndHorizontal();
}
//重绘
Repaint();
}
}
}
最后修改:2023 年 06 月 09 日
© 允许规范转载