mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Forgot these can use any collider shape, just needs to be a collider
This commit is contained in:
parent
b20cda59e9
commit
38d1605fc0
@ -8,20 +8,19 @@ namespace NewHorizons.Builder.Volumes
|
||||
{
|
||||
public static TVolume Make<TVolume>(GameObject planetGO, Sector sector, VanishVolumeInfo info) where TVolume : VanishVolume
|
||||
{
|
||||
if (info.shape != null && (info.shape?.type != External.Modules.Props.ShapeType.Sphere || info.shape?.useShape == false))
|
||||
if (info.shape != null && info.shape?.useShape == false)
|
||||
{
|
||||
NHLogger.LogError($"Destruction/VanishVolumes only support sphere colliders. Affects planet [{planetGO.name}]");
|
||||
NHLogger.LogError($"Destruction/VanishVolumes only support colliders. Affects planet [{planetGO.name}]. Set useShape to false.");
|
||||
}
|
||||
|
||||
// VanishVolume is only compatible with sphere colliders
|
||||
// If info.shape was null, it will still default to using info.radius, just make sure it does so with a collider
|
||||
// If info.shape was null, it will still default to using a sphere with info.radius, just make sure it does so with a collider
|
||||
info.shape ??= new();
|
||||
info.shape.useShape = false;
|
||||
info.shape.type = External.Modules.Props.ShapeType.Sphere;
|
||||
|
||||
var volume = VolumeBuilder.Make<TVolume>(planetGO, sector, info);
|
||||
|
||||
var collider = volume.gameObject.GetComponent<SphereCollider>();
|
||||
var collider = volume.gameObject.GetComponent<Collider>();
|
||||
volume._collider = collider;
|
||||
volume._shrinkBodies = info.shrinkBodies;
|
||||
volume._onlyAffectsPlayerAndShip = info.onlyAffectsPlayerRelatedBodies;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user