mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Update OrbitlineBuilder.cs
This commit is contained in:
parent
8cfef73e37
commit
58f12976ef
@ -10,7 +10,7 @@ namespace NewHorizons.Builder.Orbital
|
||||
{
|
||||
static class OrbitlineBuilder
|
||||
{
|
||||
public static void Make(GameObject body, AstroObject astroobject, bool isMoon, IPlanetConfig config)
|
||||
public static void Make(GameObject body, AstroObject astroObject, bool isMoon, IPlanetConfig config)
|
||||
{
|
||||
GameObject orbitGO = new GameObject("Orbit");
|
||||
orbitGO.transform.parent = body.transform;
|
||||
@ -20,17 +20,19 @@ namespace NewHorizons.Builder.Orbital
|
||||
|
||||
lineRenderer.material = config.Orbit.DottedOrbitLine ? GameObject.Find("HearthianMapSatellite_Body/OrbitLine").GetComponent<LineRenderer>().material : GameObject.Find("OrbitLine_CO").GetComponent<LineRenderer>().material;
|
||||
lineRenderer.textureMode = config.Orbit.DottedOrbitLine ? LineTextureMode.RepeatPerSegment : LineTextureMode.Stretch;
|
||||
int se = config.Orbit.DottedOrbitLine ? 100 : 50;
|
||||
lineRenderer.startWidth = se;
|
||||
lineRenderer.endWidth = se;
|
||||
|
||||
var width = config.Orbit.DottedOrbitLine ? 100 : 50;
|
||||
lineRenderer.startWidth = width;
|
||||
lineRenderer.endWidth = width;
|
||||
lineRenderer.useWorldSpace = false;
|
||||
lineRenderer.loop = false;
|
||||
int vp = config.Orbit.DottedOrbitLine ? 128 : 256;
|
||||
lineRenderer.positionCount = vp;
|
||||
|
||||
var numVerts = config.Orbit.DottedOrbitLine ? 128 : 256;
|
||||
lineRenderer.positionCount = numVerts;
|
||||
|
||||
var ecc = config.Orbit.Eccentricity;
|
||||
|
||||
var parentGravity = astroobject.GetPrimaryBody()?.GetGravityVolume();
|
||||
var parentGravity = astroObject.GetPrimaryBody()?.GetGravityVolume();
|
||||
|
||||
OrbitLine orbitLine;
|
||||
|
||||
@ -72,10 +74,10 @@ namespace NewHorizons.Builder.Orbital
|
||||
|
||||
orbitLine._color = color;
|
||||
|
||||
orbitLine._astroObject = astroobject;
|
||||
orbitLine._astroObject = astroObject;
|
||||
orbitLine._fade = fade;
|
||||
orbitLine._lineWidth = 2f;
|
||||
orbitLine._numVerts = vp;
|
||||
orbitLine._numVerts = numVerts;
|
||||
|
||||
Main.Instance.ModHelper.Events.Unity.FireOnNextUpdate(() =>
|
||||
typeof(OrbitLine).GetMethod("InitializeLineRenderer", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance).Invoke(orbitLine, new object[] { })
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user