本文整理汇总了C#中CelestialBody.RealCbUpdate方法的典型用法代码示例。如果您正苦于以下问题:C# CelestialBody.RealCbUpdate方法的具体用法?C# CelestialBody.RealCbUpdate怎么用?C# CelestialBody.RealCbUpdate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CelestialBody
的用法示例。
在下文中一共展示了CelestialBody.RealCbUpdate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CopyTo
public void CopyTo(CelestialBody body, bool setOrbit)
{
body.GeeASL = GeeASL;
body.ocean = ocean;
body.atmosphere = atmosphere;
body.atmosphereContainsOxygen = atmosphereContainsOxygen;
body.atmosphereDepth = atmosphereDepth;
body.atmosphereTemperatureSeaLevel = atmosphereTemperatureSeaLevel;
body.atmospherePressureSeaLevel = atmospherePressureSeaLevel;
body.atmosphereMolarMass = atmosphereMolarMass;
body.atmosphereAdiabaticIndex = atmosphereAdiabaticIndex;
body.rotates = rotates;
body.rotationPeriod = rotationPeriod;
body.initialRotation = initialRotation;
body.tidallyLocked = tidallyLocked;
if (setOrbit && body.orbitDriver != null && orbit != null)
body.SetOrbit(orbit);
body.RealCbUpdate();
Extensions.Log($"Set body \"{body.bodyName}\"'s parameters to:\n{GetConfig(body)}");
}
示例2: ApplyConfig
public static void ApplyConfig(ConfigNode node, CelestialBody body)
{
node.TryGetValue("GeeASL", ref body.GeeASL, double.TryParse);
node.TryGetValue("ocean", ref body.ocean, bool.TryParse);
node.TryGetValue("atmosphere", ref body.atmosphere, bool.TryParse);
node.TryGetValue("atmosphereContainsOxygen", ref body.atmosphereContainsOxygen, bool.TryParse);
node.TryGetValue("atmosphereDepth", ref body.atmosphereDepth, double.TryParse);
node.TryGetValue("atmosphereTemperatureSeaLevel", ref body.atmosphereTemperatureSeaLevel, double.TryParse);
node.TryGetValue("atmospherePressureSeaLevel", ref body.atmospherePressureSeaLevel, double.TryParse);
node.TryGetValue("atmosphereMolarMass", ref body.atmosphereMolarMass, double.TryParse);
node.TryGetValue("atmosphereAdiabaticIndex", ref body.atmosphereAdiabaticIndex, double.TryParse);
node.TryGetValue("rotates", ref body.rotates, bool.TryParse);
node.TryGetValue("rotationPeriod", ref body.rotationPeriod, double.TryParse);
node.TryGetValue("initialRotation", ref body.initialRotation, double.TryParse);
node.TryGetValue("tidallyLocked", ref body.tidallyLocked, bool.TryParse);
if (body.orbitDriver != null)
{
var orbit = body.orbitDriver.orbit.Clone();
node.TryGetValue("inclination", ref orbit.inclination, double.TryParse);
node.TryGetValue("eccentricity", ref orbit.eccentricity, double.TryParse);
node.TryGetValue("semiMajorAxis", ref orbit.semiMajorAxis, double.TryParse);
node.TryGetValue("LAN", ref orbit.LAN, double.TryParse);
node.TryGetValue("argumentOfPeriapsis", ref orbit.argumentOfPeriapsis, double.TryParse);
node.TryGetValue("meanAnomalyAtEpoch", ref orbit.meanAnomalyAtEpoch, double.TryParse);
node.TryGetValue("orbitEpoch", ref orbit.epoch, double.TryParse);
node.TryGetValue("orbitBody", ref orbit.referenceBody, Extensions.CbTryParse);
body.SetOrbit(orbit);
}
body.RealCbUpdate();
Extensions.Log($"Set body \"{body.bodyName}\"'s parameters to:\n{GetConfig(body)}");
}