From 0cbfdb445819b51b7873586a8f70f61e075fa7b5 Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Sat, 9 Jul 2022 16:23:04 -0700 Subject: [PATCH] make it only allocate list if its not in the cache --- NewHorizons/Handlers/StreamingHandler.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/NewHorizons/Handlers/StreamingHandler.cs b/NewHorizons/Handlers/StreamingHandler.cs index 1c20d549..0d7dd0b1 100644 --- a/NewHorizons/Handlers/StreamingHandler.cs +++ b/NewHorizons/Handlers/StreamingHandler.cs @@ -35,14 +35,15 @@ namespace NewHorizons.Handlers /// public static void HookStreaming(GameObject obj, Sector sector = null) { - var assetBundles = new List(); - + List assetBundles; if (_objectCache.ContainsKey(obj)) { assetBundles = _objectCache[obj]; } else { + assetBundles = new List(); + var tables = Resources.FindObjectsOfTypeAll(); foreach (var streamingHandle in obj.GetComponentsInChildren()) {