mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Made it do we can remove children of existing planets
This commit is contained in:
parent
44f87131c9
commit
59647c7f4c
1
NewHorizons/External/IPlanetConfig.cs
vendored
1
NewHorizons/External/IPlanetConfig.cs
vendored
@ -8,6 +8,7 @@ namespace NewHorizons.External
|
||||
string Name { get; }
|
||||
string StarSystem { get; }
|
||||
bool Destroy { get; }
|
||||
string[] ChildrenToDestroy { get; }
|
||||
int BuildPriority { get; }
|
||||
BaseModule Base { get; }
|
||||
AtmosphereModule Atmosphere { get; }
|
||||
|
||||
1
NewHorizons/External/PlanetConfig.cs
vendored
1
NewHorizons/External/PlanetConfig.cs
vendored
@ -11,6 +11,7 @@ namespace NewHorizons.External
|
||||
public string Name { get; set; }
|
||||
public string StarSystem { get; set; } = "SolarSystem";
|
||||
public bool Destroy { get; set; }
|
||||
public string[] ChildrenToDestroy { get; set; }
|
||||
public int BuildPriority { get; set; } = -1;
|
||||
public BaseModule Base { get; set; }
|
||||
public AtmosphereModule Atmosphere { get; set; }
|
||||
|
||||
@ -391,6 +391,14 @@ namespace NewHorizons
|
||||
var sector = go.GetComponentInChildren<Sector>();
|
||||
var rb = go.GetAttachedOWRigidbody();
|
||||
|
||||
if (body.Config.ChildrenToDestroy != null && body.Config.ChildrenToDestroy.Length > 0)
|
||||
{
|
||||
foreach (var child in body.Config.ChildrenToDestroy)
|
||||
{
|
||||
GameObject.Find(go.name + "/" + child).SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
// Do stuff that's shared between generating new planets and updating old ones
|
||||
return SharedGenerateBody(body, go, sector, rb);
|
||||
}
|
||||
@ -564,7 +572,7 @@ namespace NewHorizons
|
||||
|
||||
// Do this next tick so we can raycast the planet to place things on the surface
|
||||
if (body.Config.Props != null)
|
||||
PropBuilder.Make(go, sector, body.Config, body.Mod.Assets, body.Mod.Manifest.UniqueName);
|
||||
PropBuildManager.Make(go, sector, body.Config, body.Mod.Assets, body.Mod.Manifest.UniqueName);
|
||||
|
||||
if (body.Config.Signal != null)
|
||||
SignalBuilder.Make(go, sector, body.Config.Signal, body.Mod);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user