mirror of
https://git.shazbot.fr/shazbot/Utils.git
synced 2026-01-12 05:00:58 +01:00
Use quitting instead of on application quit.
This commit is contained in:
@@ -4,6 +4,16 @@ namespace Utils
|
|||||||
{
|
{
|
||||||
public class EventManager : MonoBehaviour
|
public class EventManager : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
private void Awake()
|
||||||
|
{
|
||||||
|
Application.quitting += OnQuitting;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnDestroy()
|
||||||
|
{
|
||||||
|
Application.quitting -= OnQuitting;
|
||||||
|
}
|
||||||
|
|
||||||
private void Update()
|
private void Update()
|
||||||
{
|
{
|
||||||
App.InvokeEarlyUpdate();
|
App.InvokeEarlyUpdate();
|
||||||
@@ -16,7 +26,7 @@ namespace Utils
|
|||||||
App.InvokeLastUpdate();
|
App.InvokeLastUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnApplicationQuit()
|
private void OnQuitting()
|
||||||
{
|
{
|
||||||
App.ClearUpdate();
|
App.ClearUpdate();
|
||||||
App.ClearLateUpdate();
|
App.ClearLateUpdate();
|
||||||
|
|||||||
@@ -4,12 +4,22 @@ namespace Utils
|
|||||||
{
|
{
|
||||||
public class PhysicsEventManager : MonoBehaviour
|
public class PhysicsEventManager : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
private void Awake()
|
||||||
|
{
|
||||||
|
Application.quitting += OnQuitting;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnDestroy()
|
||||||
|
{
|
||||||
|
Application.quitting -= OnQuitting;
|
||||||
|
}
|
||||||
|
|
||||||
private void FixedUpdate()
|
private void FixedUpdate()
|
||||||
{
|
{
|
||||||
App.InvokeFixedUpdate();
|
App.InvokeFixedUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnApplicationQuit()
|
private void OnQuitting()
|
||||||
{
|
{
|
||||||
App.ClearFixedUpdate();
|
App.ClearFixedUpdate();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ru.shazbot.utils",
|
"name": "ru.shazbot.utils",
|
||||||
"version": "7.0.0",
|
"version": "7.0.1",
|
||||||
"displayName": "Utils",
|
"displayName": "Utils",
|
||||||
"description": "Utility useful for almost any project.",
|
"description": "Utility useful for almost any project.",
|
||||||
"licensesUrl": "https://git.shazbot.ru/shazbot/Utils/src/LICENSE.md",
|
"licensesUrl": "https://git.shazbot.ru/shazbot/Utils/src/LICENSE.md",
|
||||||
|
|||||||
Reference in New Issue
Block a user