Show event manager methods. Remove fixed update.
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
using UnityEngine;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Utils
|
||||
{
|
||||
@ -8,10 +9,6 @@ namespace Utils
|
||||
|
||||
public static event UpdateAction Updated;
|
||||
|
||||
public delegate void FixedUpdateAction();
|
||||
|
||||
public static event FixedUpdateAction FixedUpdated;
|
||||
|
||||
public delegate void LateUpdateAction();
|
||||
|
||||
public static event LateUpdateAction LateUpdated;
|
||||
@ -31,60 +28,26 @@ namespace Utils
|
||||
Updated?.Invoke();
|
||||
}
|
||||
|
||||
private void FixedUpdate()
|
||||
{
|
||||
FixedUpdated?.Invoke();
|
||||
}
|
||||
|
||||
private void LateUpdate()
|
||||
{
|
||||
LateUpdated?.Invoke();
|
||||
LastUpdated?.Invoke();
|
||||
}
|
||||
|
||||
public static int UpdateLength
|
||||
{
|
||||
get
|
||||
{
|
||||
var list = Updated?.GetInvocationList();
|
||||
return list?.Length ?? 0;
|
||||
}
|
||||
}
|
||||
public static Delegate[] EarlyUpdateDelegates => EarlyUpdated?.GetInvocationList();
|
||||
|
||||
public static int FixedUpdateLength
|
||||
{
|
||||
get
|
||||
{
|
||||
var list = FixedUpdated?.GetInvocationList();
|
||||
return list?.Length ?? 0;
|
||||
}
|
||||
}
|
||||
public static int EarlyUpdateLength => EarlyUpdateDelegates?.Length ?? 0;
|
||||
|
||||
public static int LateUpdateLength
|
||||
{
|
||||
get
|
||||
{
|
||||
var list = LateUpdated?.GetInvocationList();
|
||||
return list?.Length ?? 0;
|
||||
}
|
||||
}
|
||||
public static Delegate[] UpdateDelegates => Updated?.GetInvocationList();
|
||||
|
||||
public static int EarlyUpdateLength
|
||||
{
|
||||
get
|
||||
{
|
||||
var list = EarlyUpdated?.GetInvocationList();
|
||||
return list?.Length ?? 0;
|
||||
}
|
||||
}
|
||||
public static int UpdateLength => UpdateDelegates?.Length ?? 0;
|
||||
|
||||
public static int LastUpdateLength
|
||||
{
|
||||
get
|
||||
{
|
||||
var list = LastUpdated?.GetInvocationList();
|
||||
return list?.Length ?? 0;
|
||||
}
|
||||
}
|
||||
public static Delegate[] LateUpdateDelegates => LateUpdated?.GetInvocationList();
|
||||
|
||||
public static int LateUpdateLength => LateUpdateDelegates?.Length ?? 0;
|
||||
|
||||
public static Delegate[] LastUpdateDelegates => LastUpdated?.GetInvocationList();
|
||||
|
||||
public static int LastUpdateLength => LastUpdateDelegates?.Length ?? 0;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user