本文整理汇总了C#中CelestialBody.GetComponentsInChildren方法的典型用法代码示例。如果您正苦于以下问题:C# CelestialBody.GetComponentsInChildren方法的具体用法?C# CelestialBody.GetComponentsInChildren怎么用?C# CelestialBody.GetComponentsInChildren使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CelestialBody
的用法示例。
在下文中一共展示了CelestialBody.GetComponentsInChildren方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetOcean
private PQS GetOcean()
{
if (_ocean == null || mainBody != part.vessel.mainBody)
{
mainBody = part.vessel.mainBody;
_ocean = mainBody.GetComponentsInChildren<PQS>(true).FirstOrDefault(p => p.name == mainBody.transform.name + "Ocean");
}
return _ocean;
}
示例2: FindInterestingThings
private static IEnumerable<Transform> FindInterestingThings(CelestialBody body)
{
return body.GetComponentsInChildren<Transform>().Where(child => !InterestingThingIgnores.Any(i => child.name.StartsWith(i)) && !child.name.StartsWith(body.name));
}
示例3: Start
void Start()
{
foreach (CelestialBody cb in FlightGlobals.Bodies)
{
body = cb;
resize = body.Has("resize") ? body.Get<double>("resize") : 1;
landscape = body.Has("landscape") ? body.Get<double>("landscape") : 1;
resizeBuildings = body.Has("resizeBuildings") ? body.Get<double>("resizeBuildings") : 1;
foreach (PQSCity mod in body.GetComponentsInChildren<PQSCity>(true))
{
CityFixer(mod);
}
foreach (PQSCity2 mod in body.GetComponentsInChildren<PQSCity2>(true))
{
City2Fixer(mod);
}
}
}