mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
make this a teeny bit faster
This commit is contained in:
parent
3df4fc913e
commit
c84bd9fb11
@ -74,8 +74,12 @@ namespace NewHorizons.Handlers
|
|||||||
StreamingManager.LoadStreamingAssets(assetBundle);
|
StreamingManager.LoadStreamingAssets(assetBundle);
|
||||||
|
|
||||||
// Track the sector even if its null. null means stay loaded forever
|
// Track the sector even if its null. null means stay loaded forever
|
||||||
if (!_sectorCache.ContainsKey(assetBundle)) _sectorCache.Add(assetBundle, new List<Sector>());
|
if (!_sectorCache.TryGetValue(assetBundle, out var sectors))
|
||||||
if (!_sectorCache[assetBundle].Contains(sector)) _sectorCache[assetBundle].Add(sector);
|
{
|
||||||
|
sectors = new List<Sector>();
|
||||||
|
_sectorCache.Add(assetBundle, sectors);
|
||||||
|
}
|
||||||
|
sectors.SafeAdd(sector);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sector)
|
if (sector)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user