Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Runtime/PlayerLoopInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ public static class PlayerLoopInterface {

private static List<PlayerLoopSystem> insertedSystems = new List<PlayerLoopSystem>();

[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.
Expand All @@ -46,6 +47,7 @@ private static void ClearInsertedSystems ()

Application.quitting -= ClearInsertedSystems;
}
#endif

private enum InsertType {
Before,
Expand Down Expand Up @@ -226,7 +228,7 @@ private static void InsertSystem(ref PlayerLoopSystem currentLoopRecursive, Play
couldInsert = false;
}
}

/// <summary>
/// Utility to get a string representation of the current player loop.
/// </summary>
Expand Down