diff --git a/Runtime/EventManager.cs b/Runtime/EventManager.cs index 0a077dc..939947f 100644 --- a/Runtime/EventManager.cs +++ b/Runtime/EventManager.cs @@ -34,6 +34,14 @@ namespace Utils LastUpdated?.Invoke(); } + private void OnApplicationQuit() + { + Updated = null; + LateUpdated = null; + EarlyUpdated = null; + LastUpdated = null; + } + public static Delegate[] EarlyUpdateDelegates => EarlyUpdated?.GetInvocationList(); public static int EarlyUpdateLength => EarlyUpdateDelegates?.Length ?? 0; diff --git a/Runtime/PhysicsEventManager.cs b/Runtime/PhysicsEventManager.cs index 9381075..7b8faa5 100644 --- a/Runtime/PhysicsEventManager.cs +++ b/Runtime/PhysicsEventManager.cs @@ -14,6 +14,11 @@ namespace Utils FixedUpdated?.Invoke(); } + private void OnApplicationQuit() + { + FixedUpdated = null; + } + public static Delegate[] FixedUpdateDelegates => FixedUpdated?.GetInvocationList(); public static int FixedUpdateLength => FixedUpdateDelegates?.Length ?? 0; diff --git a/package.json b/package.json index a9b28a5..a8d4f95 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ru.shazbot.utils", - "version": "6.1.0", + "version": "6.1.1", "displayName": "Utils", "description": "Utility useful for almost any project.", "licensesUrl": "https://git.shazbot.ru/shazbot/Utils/src/LICENSE.md",