Added early update event.
This commit is contained in:
@ -33,6 +33,14 @@ namespace Utils
|
|||||||
GUILayout.Label(EventManager.LateUpdateLength.ToString());
|
GUILayout.Label(EventManager.LateUpdateLength.ToString());
|
||||||
}
|
}
|
||||||
GUILayout.EndHorizontal();
|
GUILayout.EndHorizontal();
|
||||||
|
GUILayout.BeginHorizontal();
|
||||||
|
GUILayout.Label("EarlyUpdate");
|
||||||
|
if (Application.isPlaying)
|
||||||
|
{
|
||||||
|
GUILayout.FlexibleSpace();
|
||||||
|
GUILayout.Label(EventManager.EarlyUpdateLength.ToString());
|
||||||
|
}
|
||||||
|
GUILayout.EndHorizontal();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,9 +12,14 @@ namespace Utils
|
|||||||
|
|
||||||
public delegate void LateUpdateAction();
|
public delegate void LateUpdateAction();
|
||||||
public static event LateUpdateAction LateUpdated;
|
public static event LateUpdateAction LateUpdated;
|
||||||
|
|
||||||
|
public delegate void EarlyUpdateAction();
|
||||||
|
public static event EarlyUpdateAction EarlyUpdated;
|
||||||
|
|
||||||
|
|
||||||
private void Update()
|
private void Update()
|
||||||
{
|
{
|
||||||
|
EarlyUpdated?.Invoke();
|
||||||
Updated?.Invoke();
|
Updated?.Invoke();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,5 +59,14 @@ namespace Utils
|
|||||||
return list?.Length ?? 0;
|
return list?.Length ?? 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static int EarlyUpdateLength
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
var list = EarlyUpdated?.GetInvocationList();
|
||||||
|
return list?.Length ?? 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ru.shazbot.utils",
|
"name": "ru.shazbot.utils",
|
||||||
"version": "5.1.0",
|
"version": "5.2.0",
|
||||||
"displayName": "Utils",
|
"displayName": "Utils",
|
||||||
"description": "Utility useful for almost any project.",
|
"description": "Utility useful for almost any project.",
|
||||||
"licensesUrl": "https://git.shazbot.ru/Utils.git/tree/LICENSE.md",
|
"licensesUrl": "https://git.shazbot.ru/Utils.git/tree/LICENSE.md",
|
||||||
|
Reference in New Issue
Block a user