diff --git a/Runtime/PlayerLoopInterface.cs b/Runtime/PlayerLoopInterface.cs index a38ef2f..6e1cf06 100644 --- a/Runtime/PlayerLoopInterface.cs +++ b/Runtime/PlayerLoopInterface.cs @@ -29,7 +29,8 @@ public static class PlayerLoopInterface { private static List insertedSystems = new List(); - [RuntimeInitializeOnLoadMethod] +#if UNITY_EDITOR + [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] 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. @@ -46,6 +47,7 @@ private static void ClearInsertedSystems () Application.quitting -= ClearInsertedSystems; } +#endif private enum InsertType { Before, @@ -226,7 +228,7 @@ private static void InsertSystem(ref PlayerLoopSystem currentLoopRecursive, Play couldInsert = false; } } - + /// /// Utility to get a string representation of the current player loop. ///