Added separate EventManger for FixedUpdate.
This commit is contained in:
@ -2,10 +2,10 @@
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Utils
|
||||
namespace Utils.Editor
|
||||
{
|
||||
[CustomEditor(typeof(EventManager), true)]
|
||||
public class EventManagerEditor : Editor
|
||||
public class EventManagerEditor : UnityEditor.Editor
|
||||
{
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
|
34
Editor/PhysicsEventMangerEditor.cs
Normal file
34
Editor/PhysicsEventMangerEditor.cs
Normal file
@ -0,0 +1,34 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
3
Editor/PhysicsEventMangerEditor.cs.meta
Normal file
3
Editor/PhysicsEventMangerEditor.cs.meta
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2dc65e2b44db4ae5ac60ad4ecf343e82
|
||||
timeCreated: 1713873473
|
@ -1,7 +1,7 @@
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Utils
|
||||
namespace Utils.Editor
|
||||
{
|
||||
[CustomPropertyDrawer(typeof(ReadOnlyFieldAttribute))]
|
||||
public class ReadOnlyFieldDrawer : PropertyDrawer
|
||||
|
@ -1,7 +1,7 @@
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Utils
|
||||
namespace Utils.Editor
|
||||
{
|
||||
[CustomPropertyDrawer(typeof(ReadOnlyOnPlayFieldAttribute))]
|
||||
public class ReadOnlyOnPlayFieldDrawer : PropertyDrawer
|
||||
|
@ -1,7 +1,7 @@
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Utils
|
||||
namespace Utils.Editor
|
||||
{
|
||||
[InitializeOnLoad]
|
||||
public static class SceneViewRotation
|
||||
|
Reference in New Issue
Block a user