Added separate EventManger for FixedUpdate.
This commit is contained in:
21
Runtime/PhysicsEventManager.cs
Normal file
21
Runtime/PhysicsEventManager.cs
Normal 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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user