Added last update event.
This commit is contained in:
parent
5991e60e7a
commit
5c67095132
@ -5,17 +5,25 @@ namespace Utils
|
||||
public class EventManager : MonoBehaviour
|
||||
{
|
||||
public delegate void UpdateAction();
|
||||
|
||||
public static event UpdateAction Updated;
|
||||
|
||||
public delegate void FixedUpdateAction();
|
||||
|
||||
public static event FixedUpdateAction FixedUpdated;
|
||||
|
||||
public delegate void LateUpdateAction();
|
||||
|
||||
public static event LateUpdateAction LateUpdated;
|
||||
|
||||
|
||||
public delegate void EarlyUpdateAction();
|
||||
|
||||
public static event EarlyUpdateAction EarlyUpdated;
|
||||
|
||||
public delegate void LastUpdateAction();
|
||||
|
||||
public static event LastUpdateAction LastUpdated;
|
||||
|
||||
|
||||
private void Update()
|
||||
{
|
||||
@ -31,6 +39,7 @@ namespace Utils
|
||||
private void LateUpdate()
|
||||
{
|
||||
LateUpdated?.Invoke();
|
||||
LastUpdated?.Invoke();
|
||||
}
|
||||
|
||||
public static int UpdateLength
|
||||
@ -59,7 +68,7 @@ namespace Utils
|
||||
return list?.Length ?? 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static int EarlyUpdateLength
|
||||
{
|
||||
get
|
||||
@ -68,5 +77,14 @@ namespace Utils
|
||||
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