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 += () =>
|
sector.OnOccupantEnterSector += sectorDetector =>
|
||||||
{
|
|
||||||
if (sector.ContainsOccupant(DynamicOccupant.Player))
|
|
||||||
{
|
{
|
||||||
|
if (sectorDetector.GetOccupantType() != DynamicOccupant.Player) return;
|
||||||
foreach (var assetBundle in assetBundles)
|
foreach (var assetBundle in assetBundles)
|
||||||
{
|
{
|
||||||
StreamingManager.LoadStreamingAssets(assetBundle);
|
StreamingManager.LoadStreamingAssets(assetBundle);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
else
|
sector.OnOccupantExitSector += sectorDetector =>
|
||||||
{
|
{
|
||||||
|
if (sectorDetector.GetOccupantType() != DynamicOccupant.Player) return;
|
||||||
foreach (var assetBundle in assetBundles)
|
foreach (var assetBundle in assetBundles)
|
||||||
{
|
{
|
||||||
StreamingManager.UnloadStreamingAssets(assetBundle);
|
StreamingManager.UnloadStreamingAssets(assetBundle);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user