Added separate EventManger for FixedUpdate.

This commit is contained in:
2024-04-23 14:03:38 +02:00
parent 6b0bb3de6b
commit 1ca24af85a
11 changed files with 85 additions and 37 deletions

View File

@@ -0,0 +1,21 @@
using System;
using UnityEngine;
namespace Utils
{
public class PhysicsEventManager : MonoBehaviour
{
public delegate void FixedUpdateAction();
public static event FixedUpdateAction FixedUpdated;
private void FixedUpdate()
{
FixedUpdated?.Invoke();
}
public static Delegate[] FixedUpdateDelegates => FixedUpdated?.GetInvocationList();
public static int FixedUpdateLength => FixedUpdateDelegates?.Length ?? 0;
}
}