From 3a29800cdae9c54923099accfd6d4e7a9c6bca30 Mon Sep 17 00:00:00 2001 From: TommyXL <104814436+Tommy-XL@users.noreply.github.com> Date: Sun, 5 Apr 2026 15:29:57 +0800 Subject: [PATCH] Clean Up Memory Of Un Useless Objects After End Game (#560) * Cleam Up Memory After Game * Remove --- Patches/OutroPatch.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Patches/OutroPatch.cs b/Patches/OutroPatch.cs index 3bc72b704..3042d85f5 100644 --- a/Patches/OutroPatch.cs +++ b/Patches/OutroPatch.cs @@ -472,6 +472,9 @@ internal static class SetEverythingUpPatch EndOfText: LastWinsText = winnerText.text /*.RemoveHtmlTags()*/; + + // Cleam up memory for objects that are no longer referenced + GC.Collect(); return; IEnumerator SetupPoolablePlayers() @@ -479,6 +482,8 @@ internal static class SetEverythingUpPatch Camera main = Camera.main; if (!main) yield break; + // Clear unused assets + Resources.UnloadUnusedAssets(); yield return null; Vector3 pos = main.ViewportToWorldPoint(new(0f, 1f, main.nearClipPlane));