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
|
||||
{
|
||||
private void Awake()
|
||||
{
|
||||
Application.quitting += OnQuitting;
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
Application.quitting -= OnQuitting;
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
App.InvokeEarlyUpdate();
|
||||
@@ -16,7 +26,7 @@ namespace Utils
|
||||
App.InvokeLastUpdate();
|
||||
}
|
||||
|
||||
private void OnApplicationQuit()
|
||||
private void OnQuitting()
|
||||
{
|
||||
App.ClearUpdate();
|
||||
App.ClearLateUpdate();
|
||||
|
||||
@@ -4,12 +4,22 @@ namespace Utils
|
||||
{
|
||||
public class PhysicsEventManager : MonoBehaviour
|
||||
{
|
||||
private void Awake()
|
||||
{
|
||||
Application.quitting += OnQuitting;
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
Application.quitting -= OnQuitting;
|
||||
}
|
||||
|
||||
private void FixedUpdate()
|
||||
{
|
||||
App.InvokeFixedUpdate();
|
||||
}
|
||||
|
||||
private void OnApplicationQuit()
|
||||
private void OnQuitting()
|
||||
{
|
||||
App.ClearFixedUpdate();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user