-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
This is an insignificant improvement, but code starting on line
| [RuntimeInitializeOnLoadMethod] |
[RuntimeInitializeOnLoadMethod]
private static void Initialize() {
// Systems are not automatically removed from the PlayerLoop, so we need to clean up the ones that have been added in play mode, as they'd otherwise
// keep running when outside play mode, and in the next play mode if we don't have assembly reload turned on.
Application.quitting += ClearInsertedSystems;
}
private static void ClearInsertedSystems ()
{
foreach (var playerLoopSystem in insertedSystems)
TryRemoveSystem(playerLoopSystem.type);
insertedSystems.Clear();
Application.quitting -= ClearInsertedSystems;
}
could be probably wrapped in #IF_UNITY_EDITOR, as it's not necessary in build.
Even smaller thing: consider using [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)], probably does not change anything (I tested edge case when I called EditorApplication.ExitPlaymode(); from other [RuntimeInitializeOnLoadMehthod] method and this still got executed), but it exists for purposes like this.
Btw great package, thank you for making it available for everyone.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels