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.
This is an insignificant improvement, but code starting on line
PlayerLoopInterface/Runtime/PlayerLoopInterface.cs
Line 32 in 141abb7
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.