Added last update event.
This commit is contained in:
parent
5991e60e7a
commit
5c67095132
@ -5,17 +5,25 @@ namespace Utils
|
|||||||
public class EventManager : MonoBehaviour
|
public class EventManager : MonoBehaviour
|
||||||
{
|
{
|
||||||
public delegate void UpdateAction();
|
public delegate void UpdateAction();
|
||||||
|
|
||||||
public static event UpdateAction Updated;
|
public static event UpdateAction Updated;
|
||||||
|
|
||||||
public delegate void FixedUpdateAction();
|
public delegate void FixedUpdateAction();
|
||||||
|
|
||||||
public static event FixedUpdateAction FixedUpdated;
|
public static event FixedUpdateAction FixedUpdated;
|
||||||
|
|
||||||
public delegate void LateUpdateAction();
|
public delegate void LateUpdateAction();
|
||||||
|
|
||||||
public static event LateUpdateAction LateUpdated;
|
public static event LateUpdateAction LateUpdated;
|
||||||
|
|
||||||
public delegate void EarlyUpdateAction();
|
public delegate void EarlyUpdateAction();
|
||||||
|
|
||||||
public static event EarlyUpdateAction EarlyUpdated;
|
public static event EarlyUpdateAction EarlyUpdated;
|
||||||
|
|
||||||
|
public delegate void LastUpdateAction();
|
||||||
|
|
||||||
|
public static event LastUpdateAction LastUpdated;
|
||||||
|
|
||||||
|
|
||||||
private void Update()
|
private void Update()
|
||||||
{
|
{
|
||||||
@ -31,6 +39,7 @@ namespace Utils
|
|||||||
private void LateUpdate()
|
private void LateUpdate()
|
||||||
{
|
{
|
||||||
LateUpdated?.Invoke();
|
LateUpdated?.Invoke();
|
||||||
|
LastUpdated?.Invoke();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int UpdateLength
|
public static int UpdateLength
|
||||||
@ -68,5 +77,14 @@ namespace Utils
|
|||||||
return list?.Length ?? 0;
|
return list?.Length ?? 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static int LastUpdateLength
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
var list = LastUpdated?.GetInvocationList();
|
||||||
|
return list?.Length ?? 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user