mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
add to volume simpler
This commit is contained in:
parent
962e04994b
commit
14d75ff216
@ -116,20 +116,14 @@ namespace NewHorizons.Handlers
|
||||
// For some reason none of this seems to apply to the Player.
|
||||
// If somebody ever makes a sound volume thats somehow always applying to the player tho then itd probably be this
|
||||
|
||||
|
||||
// Sometimes the ship isn't added to the volumes it's meant to now be in
|
||||
// We'll just toggle all volumes on the planet on and off
|
||||
var shipDetector = Locator.GetShipDetector().GetComponent<AlignmentForceDetector>();
|
||||
var shipDetector2 = Locator.GetShipDetector().GetComponent<ShipFluidDetector>();
|
||||
foreach (var volume in SpawnPointBuilder.ShipSpawn.GetAttachedOWRigidbody().GetComponentsInChildren<EffectVolume>())
|
||||
{
|
||||
if (volume.GetOWTriggerVolume().GetPenetrationDistance(ship.transform.position) > 0)
|
||||
{
|
||||
// Add ship to volume
|
||||
// If it's already tracking it it will complain here but thats fine
|
||||
shipDetector.AddVolume(volume);
|
||||
shipDetector2.AddVolume(volume);
|
||||
volume.GetOWTriggerVolume().AddObjectToVolume(shipDetector.gameObject);
|
||||
volume.GetOWTriggerVolume().AddObjectToVolume(Locator.GetShipDetector());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user