本文整理汇总了C#中CelestialBody.SetupConstants方法的典型用法代码示例。如果您正苦于以下问题:C# CelestialBody.SetupConstants方法的具体用法?C# CelestialBody.SetupConstants怎么用?C# CelestialBody.SetupConstants使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CelestialBody
的用法示例。
在下文中一共展示了CelestialBody.SetupConstants方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PatchBody
//.........这里部分代码省略.........
if (node.HasNode("latitudeTemperatureSunMultCurve"))
{
body.latitudeTemperatureSunMultCurve.Load(node.GetNode("latitudeTemperatureSunMultCurve"));
}
if (node.HasNode("axialTemperatureSunMultCurve"))
{
body.axialTemperatureSunMultCurve.Load(node.GetNode("axialTemperatureSunMultCurve"));
}
if (node.HasNode("atmosphereTemperatureSunMultCurve"))
{
body.atmosphereTemperatureSunMultCurve.Load(node.GetNode("atmosphereTemperatureSunMultCurve"));
}
if (node.HasNode("axialTemperatureSunBiasCurve"))
{
body.axialTemperatureSunBiasCurve.Load(node.GetNode("axialTemperatureSunBiasCurve"));
}
if (node.HasNode("axialTemperatureSunMultCurve"))
{
body.axialTemperatureSunMultCurve.Load(node.GetNode("axialTemperatureSunMultCurve"));
}
if (node.HasNode("eccentricityTemperatureBiasCurve"))
{
body.eccentricityTemperatureBiasCurve.Load(node.GetNode("eccentricityTemperatureBiasCurve"));
}
if (node.HasValue("Radius"))
{
if (double.TryParse(node.GetValue("Radius"), out dtmp))
{
body.Radius = dtmp;
updateMass = true;
}
}
// Orbit
ConfigNode onode = node.GetNode("Orbit");
if (body.orbitDriver != null && body.orbit != null && onode != null)
{
patchOrbits = true;
if (node.HasValue("semiMajorAxis"))
if (double.TryParse(node.GetValue("semiMajorAxis"), out dtmp))
body.orbit.semiMajorAxis = dtmp;
if (node.HasValue("eccentricity"))
if (double.TryParse(node.GetValue("eccentricity"), out dtmp))
body.orbit.eccentricity = dtmp;
if (node.HasValue("meanAnomalyAtEpoch"))
if (double.TryParse(node.GetValue("meanAnomalyAtEpoch"), out dtmp))
body.orbit.meanAnomalyAtEpoch = dtmp;
if (node.HasValue("meanAnomalyAtEpochD"))
{
if (double.TryParse(node.GetValue("meanAnomalyAtEpochD"), out dtmp))
{
body.orbit.meanAnomalyAtEpoch = dtmp;
body.orbit.meanAnomalyAtEpoch *= DEG2RAD;
}
}
if (node.HasValue("inclination"))
if (double.TryParse(node.GetValue("inclination"), out dtmp))
body.orbit.inclination = dtmp;
if (node.HasValue("LAN"))
if (double.TryParse(node.GetValue("LAN"), out dtmp))
body.orbit.LAN = dtmp;
if (node.HasValue("argumentOfPeriapsis"))
if (double.TryParse(node.GetValue("argumentOfPeriapsis"), out dtmp))
body.orbit.argumentOfPeriapsis = dtmp;
}
}
else if (globalRotationRescale != 1d || globalRescale != 1d)
print("Patching body " + body.bodyName + " from globals.");
body.rotationPeriod *= globalRotationRescale;
if(globalRescale != 1d)
{
body.Radius *= globalRescale;
updateMass = true;
}
if (updateMass)
{
patchOrbits = true;
GeeASLToOthers(body);
}
if (globalRescaleAtmo != 1d && body.atmosphere)
{
body.atmospherePressureCurve = RescaleCurve(body.atmospherePressureCurve, globalRescaleAtmo);
body.atmosphereTemperatureCurve = RescaleCurve(body.atmosphereTemperatureCurve, globalRescaleAtmo);
body.atmosphereTemperatureSunMultCurve = RescaleCurve(body.atmosphereTemperatureSunMultCurve, globalRescaleAtmo);
body.atmosphereDepth *= globalRescaleAtmo;
}
body.SetupConstants();
// Fix up PQS
if(PatchPQS(body, node, origRadius) || origRadius != body.Radius)
StartCoroutine(PatchScaledSpace(body, node, origRadius));
body.CBUpdate();
return true;
}