make it only allocate list if its not in the cache

This commit is contained in:
JohnCorby 2022-07-09 16:23:04 -07:00
parent 2219b80253
commit 0cbfdb4458

View File

@ -35,14 +35,15 @@ namespace NewHorizons.Handlers
/// </summary>
public static void HookStreaming(GameObject obj, Sector sector = null)
{
var assetBundles = new List<string>();
List<string> assetBundles;
if (_objectCache.ContainsKey(obj))
{
assetBundles = _objectCache[obj];
}
else
{
assetBundles = new List<string>();
var tables = Resources.FindObjectsOfTypeAll<StreamingMaterialTable>();
foreach (var streamingHandle in obj.GetComponentsInChildren<StreamingMeshHandle>())
{