mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
use cooler events to trigger stuff less
This commit is contained in:
parent
924dadc536
commit
66b26a7263
@ -78,22 +78,21 @@ namespace NewHorizons.Handlers
|
||||
}
|
||||
}
|
||||
|
||||
sector.OnSectorOccupantsUpdated += () =>
|
||||
{
|
||||
if (sector.ContainsOccupant(DynamicOccupant.Player))
|
||||
sector.OnOccupantEnterSector += sectorDetector =>
|
||||
{
|
||||
if (sectorDetector.GetOccupantType() != DynamicOccupant.Player) return;
|
||||
foreach (var assetBundle in assetBundles)
|
||||
{
|
||||
StreamingManager.LoadStreamingAssets(assetBundle);
|
||||
}
|
||||
}
|
||||
else
|
||||
};
|
||||
sector.OnOccupantExitSector += sectorDetector =>
|
||||
{
|
||||
if (sectorDetector.GetOccupantType() != DynamicOccupant.Player) return;
|
||||
foreach (var assetBundle in assetBundles)
|
||||
{
|
||||
StreamingManager.UnloadStreamingAssets(assetBundle);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
else
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user