mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Allow more than one ring
This commit is contained in:
parent
2da1015620
commit
5ab727384b
@ -120,10 +120,13 @@ namespace NewHorizons.Builder.Body
|
||||
}
|
||||
}
|
||||
|
||||
if (body.Config.Ring != null)
|
||||
if (body.Config.Rings != null)
|
||||
{
|
||||
RingBuilder.MakeRingGraphics(proxy, null, body.Config.Ring, body.Mod);
|
||||
if (realSize < body.Config.Ring.outerRadius) realSize = body.Config.Ring.outerRadius;
|
||||
foreach (var ring in body.Config.Rings)
|
||||
{
|
||||
RingBuilder.MakeRingGraphics(proxy, null, ring, body.Mod);
|
||||
if (realSize < ring.outerRadius) realSize = ring.outerRadius;
|
||||
}
|
||||
}
|
||||
|
||||
Renderer starAtmosphere = null;
|
||||
|
||||
@ -73,7 +73,7 @@ namespace NewHorizons.Builder.Body
|
||||
return null;
|
||||
}
|
||||
|
||||
var ringGO = new GameObject("Ring");
|
||||
var ringGO = new GameObject(!string.IsNullOrEmpty(ring.rename) ? ring.rename : "Ring");
|
||||
ringGO.transform.parent = sector?.transform ?? rootObject.transform;
|
||||
ringGO.transform.position = rootObject.transform.position;
|
||||
ringGO.transform.rotation = rootObject.transform.rotation;
|
||||
|
||||
8
NewHorizons/External/Configs/PlanetConfig.cs
vendored
8
NewHorizons/External/Configs/PlanetConfig.cs
vendored
@ -67,6 +67,10 @@ namespace NewHorizons.External.Configs
|
||||
|
||||
[Obsolete("Signal is deprecated, please use Props->signals")]
|
||||
public SignalModule Signal;
|
||||
|
||||
[Obsolete("Ring is deprecated, please use Rings")]
|
||||
public RingModule Ring;
|
||||
|
||||
#endregion Obsolete
|
||||
|
||||
/// <summary>
|
||||
@ -135,9 +139,9 @@ namespace NewHorizons.External.Configs
|
||||
public string[] removeChildren;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a ring around the planet
|
||||
/// Create rings around the planet
|
||||
/// </summary>
|
||||
public RingModule Ring;
|
||||
public RingModule[] Rings;
|
||||
|
||||
/// <summary>
|
||||
/// Add sand to this planet
|
||||
|
||||
5
NewHorizons/External/Modules/RingModule.cs
vendored
5
NewHorizons/External/Modules/RingModule.cs
vendored
@ -62,5 +62,10 @@ namespace NewHorizons.External.Modules
|
||||
/// Fade rings in/out over time. Optional. Value between 0-1, time is in minutes.
|
||||
/// </summary>
|
||||
public TimeValuePair[] opacityCurve;
|
||||
|
||||
/// <summary>
|
||||
/// An optional rename of this object
|
||||
/// </summary>
|
||||
public string rename;
|
||||
}
|
||||
}
|
||||
@ -547,9 +547,12 @@ namespace NewHorizons.Handlers
|
||||
}
|
||||
}
|
||||
|
||||
if (body.Config.Ring != null)
|
||||
if (body.Config.Rings != null)
|
||||
{
|
||||
RingBuilder.Make(go, sector, body.Config.Ring, body.Mod);
|
||||
foreach (var ring in body.Config.Rings)
|
||||
{
|
||||
RingBuilder.Make(go, sector, ring, body.Mod);
|
||||
}
|
||||
}
|
||||
|
||||
if (body.Config.AsteroidBelt != null)
|
||||
|
||||
@ -107,13 +107,16 @@ namespace NewHorizons.Handlers
|
||||
}
|
||||
pivot.name = "Pivot";
|
||||
|
||||
if (body.Config.Ring != null)
|
||||
if (body.Config.Rings != null && body.Config.Rings.Length > 0)
|
||||
{
|
||||
RingModule newRing = new RingModule();
|
||||
newRing.innerRadius = size * 1.2f;
|
||||
newRing.outerRadius = size * 2f;
|
||||
newRing.texture = body.Config.Ring.texture;
|
||||
var ring = RingBuilder.Make(titleScreenGO, null, newRing, body.Mod);
|
||||
foreach (var ring in body.Config.Rings)
|
||||
{
|
||||
RingModule newRing = new RingModule();
|
||||
newRing.innerRadius = size * 1.2f;
|
||||
newRing.outerRadius = size * 2f;
|
||||
newRing.texture = ring.texture;
|
||||
RingBuilder.Make(titleScreenGO, null, newRing, body.Mod);
|
||||
}
|
||||
titleScreenGO.transform.localScale = Vector3.one * 0.8f;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user