mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Update GravityBuilder.cs
This commit is contained in:
parent
35c0b934c7
commit
a8b9c3648e
@ -36,16 +36,6 @@ namespace NewHorizons.Builder.General
|
|||||||
|
|
||||||
var owTriggerVolume = gravityGO.AddComponent<OWTriggerVolume>();
|
var owTriggerVolume = gravityGO.AddComponent<OWTriggerVolume>();
|
||||||
|
|
||||||
// If it's a focal point dont add collision stuff
|
|
||||||
if (config.FocalPoint != null)
|
|
||||||
{
|
|
||||||
owCollider.enabled = false;
|
|
||||||
owTriggerVolume.enabled = false;
|
|
||||||
sphereCollider.radius = 0;
|
|
||||||
sphereCollider.enabled = false;
|
|
||||||
sphereCollider.isTrigger = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// copied from th and qm
|
// copied from th and qm
|
||||||
var gravityVolume = gravityGO.AddComponent<GravityVolume>();
|
var gravityVolume = gravityGO.AddComponent<GravityVolume>();
|
||||||
gravityVolume._cutoffAcceleration = 0f;
|
gravityVolume._cutoffAcceleration = 0f;
|
||||||
@ -70,6 +60,21 @@ namespace NewHorizons.Builder.General
|
|||||||
gravityVolume._isPlanetGravityVolume = true;
|
gravityVolume._isPlanetGravityVolume = true;
|
||||||
gravityVolume._cutoffRadius = 0f;
|
gravityVolume._cutoffRadius = 0f;
|
||||||
|
|
||||||
|
// If it's a focal point dont add collision stuff
|
||||||
|
// This is overkill
|
||||||
|
if (config.FocalPoint != null)
|
||||||
|
{
|
||||||
|
owCollider.enabled = false;
|
||||||
|
owTriggerVolume.enabled = false;
|
||||||
|
sphereCollider.radius = 0;
|
||||||
|
sphereCollider.enabled = false;
|
||||||
|
sphereCollider.isTrigger = false;
|
||||||
|
// This should ensure that even if the player enters the volume, it counts them as being inside the zero-gee cave equivalent
|
||||||
|
gravityVolume._cutoffRadius = gravityVolume._upperSurfaceRadius;
|
||||||
|
gravityVolume._lowerSurfaceRadius = gravityVolume._upperSurfaceRadius;
|
||||||
|
gravityVolume._cutoffAcceleration = 0;
|
||||||
|
}
|
||||||
|
|
||||||
gravityGO.SetActive(true);
|
gravityGO.SetActive(true);
|
||||||
|
|
||||||
ao._gravityVolume = gravityVolume;
|
ao._gravityVolume = gravityVolume;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user