From 0944f18930fb061c922b06ae1a25e26020559c68 Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Sat, 9 Jul 2022 18:55:00 -0700 Subject: [PATCH] okay fuck it dont unload the shit cuz this error spam is annoying --- NewHorizons/Handlers/StreamingHandler.cs | 33 +++++------------------- 1 file changed, 6 insertions(+), 27 deletions(-) diff --git a/NewHorizons/Handlers/StreamingHandler.cs b/NewHorizons/Handlers/StreamingHandler.cs index 946a016e..70883dc8 100644 --- a/NewHorizons/Handlers/StreamingHandler.cs +++ b/NewHorizons/Handlers/StreamingHandler.cs @@ -67,41 +67,20 @@ namespace NewHorizons.Handlers _objectCache[obj] = assetBundles; } + foreach (var assetBundle in assetBundles) + { + StreamingManager.LoadStreamingAssets(assetBundle); + } + if (sector) { - // load it if ur already in the sector - if (sector.ContainsOccupant(DynamicOccupant.Player)) + sector.OnOccupantEnterSector += _ => { foreach (var assetBundle in assetBundles) { StreamingManager.LoadStreamingAssets(assetBundle); } - } - - sector.OnOccupantEnterSector += sectorDetector => - { - if (sectorDetector.GetOccupantType() != DynamicOccupant.Player) return; - foreach (var assetBundle in assetBundles) - { - StreamingManager.LoadStreamingAssets(assetBundle); - } }; - sector.OnOccupantExitSector += sectorDetector => - { - if (sectorDetector.GetOccupantType() != DynamicOccupant.Player) return; - foreach (var assetBundle in assetBundles) - { - StreamingManager.UnloadStreamingAssets(assetBundle); - } - }; - } - else - { - // just load it immediately and hope for the best - foreach (var assetBundle in assetBundles) - { - StreamingManager.LoadStreamingAssets(assetBundle); - } } } }