mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Allow removing vessel rigidbody
This commit is contained in:
parent
7c77eb7bad
commit
62dcc92dbb
@ -208,7 +208,10 @@ namespace NewHorizons.External.Configs
|
||||
[JsonObject]
|
||||
public class VesselInfo : PropModule.GeneralSolarSystemPropInfo
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Whether the vessel should have physics enabled. This must be set to false for the vessel to stay attached to a parent body.
|
||||
/// </summary>
|
||||
[DefaultValue(true)] public bool hasPhysics = true;
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
|
||||
@ -88,10 +88,12 @@ namespace NewHorizons.Handlers
|
||||
var vesselObject = GeneralPropBuilder.MakeFromPrefab(VesselPrefab, VesselPrefab.name, null, system.Config.Vessel?.vesselSpawn);
|
||||
VesselObject = vesselObject;
|
||||
|
||||
vesselObject.transform.parent = null;
|
||||
|
||||
var vesselAO = vesselObject.AddComponent<EyeAstroObject>();
|
||||
vesselAO._owRigidbody = vesselObject.GetComponent<OWRigidbody>();
|
||||
if (system.Config.Vessel?.vesselSpawn.hasPhysics ?? true)
|
||||
{
|
||||
vesselAO._owRigidbody = vesselObject.GetComponent<OWRigidbody>();
|
||||
vesselObject.transform.parent = null;
|
||||
}
|
||||
vesselAO._rootSector = vesselObject.GetComponentInChildren<Sector>(true);
|
||||
vesselAO._customName = "Vessel";
|
||||
vesselAO._name = AstroObject.Name.CustomString;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user