34 lines
992 B
C#
34 lines
992 B
C#
using System;
|
|
using UnityEditor;
|
|
using UnityEngine;
|
|
|
|
namespace Utils.Editor
|
|
{
|
|
[CustomEditor(typeof(PhysicsEventManager), true)]
|
|
public class PhysicsEventManagerEditor : UnityEditor.Editor
|
|
{
|
|
public override void OnInspectorGUI()
|
|
{
|
|
Event("FixedUpdate", PhysicsEventManager.FixedUpdateLength, PhysicsEventManager.FixedUpdateDelegates);
|
|
}
|
|
|
|
private void Event(string title, int length, Delegate[] delegates)
|
|
{
|
|
{
|
|
GUILayout.BeginHorizontal();
|
|
|
|
GUILayout.Label(title, EditorStyles.boldLabel);
|
|
GUILayout.FlexibleSpace();
|
|
GUILayout.Label(length.ToString());
|
|
|
|
GUILayout.EndHorizontal();
|
|
|
|
if (length == 0) return;
|
|
foreach (var d in delegates)
|
|
{
|
|
GUILayout.Label($"{d.Method.DeclaringType}.{d.Method.Name}", EditorStyles.miniLabel);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |