本文整理汇总了C#中Part.GetComponentsInChildren方法的典型用法代码示例。如果您正苦于以下问题:C# Part.GetComponentsInChildren方法的具体用法?C# Part.GetComponentsInChildren怎么用?C# Part.GetComponentsInChildren使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Part
的用法示例。
在下文中一共展示了Part.GetComponentsInChildren方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetCamera
public static Camera GetCamera(Part host)
{
Camera[] camList = host.GetComponentsInChildren<Camera>();
if(camList.Count() != 0)
{
foreach (Camera c in camList)
{
Debug.Log(c.name);
}
return camList[0];
}
return null;
}
示例2: locateAirlock
private static Transform locateAirlock(Part part)
{
Collider[] componentsInChildren = part.GetComponentsInChildren<Collider>();
int len = componentsInChildren.Length;
for (int i = 0; i < len; i++)
{
if (componentsInChildren[i].gameObject.tag == "Airlock")
{
return componentsInChildren[i].transform;
}
}
return null;
}
示例3: FARdebug
private static void FARdebug(Part part)
{
MonoBehaviour.print("FAR DEBUG FOR PART: " + part);
GameObject go;
Mesh m;
Mesh m2;
MeshFilter[] mfs = part.GetComponentsInChildren<MeshFilter>();
MeshFilter mf;
int len = mfs.Length;
for (int i = 0; i < len; i++)
{
mf = mfs[i];
m = mf.mesh;
m2 = mf.sharedMesh;
go = mf.gameObject;
MonoBehaviour.print("FAR debug data || go: " + go + " || mf: " + mf + " || mesh: " + m + " || sharedMesh" + m2);
}
MonoBehaviour.print("-------------------------------------------------------------------------");
}
示例4: PartHideRecursive
private void PartHideRecursive(VesselElementViewOptions ol, VesselElementViewOption o, Part part)
{
MonoBehaviour.print("Hiding Part " + part.ToString());
foreach (var r in part.GetComponentsInChildren<Renderer>())
{
r.enabled = false;
}
}
示例5: PrintInternals
/*public void DrawPositionLines()
{
upLine.SetPosition(0, InternalCamera.Instance.transform.position);
upLine.SetPosition(1, InternalCamera.Instance.transform.position + InternalCamera.Instance.transform.up); // Green
rightLine.SetPosition(0, InternalCamera.Instance.transform.position);
rightLine.SetPosition(1, InternalCamera.Instance.transform.position + InternalCamera.Instance.transform.right); // Blue
forwardLine.SetPosition(0, InternalCamera.Instance.transform.position);
forwardLine.SetPosition(1, InternalCamera.Instance.transform.position + InternalCamera.Instance.transform.forward); // Red
}*/
public static void PrintInternals(Part p)
{
Debug.Log("Part: " + p);
MeshRenderer[] componentsInChildren = p.GetComponentsInChildren<MeshRenderer>();
MeshRenderer[] array = componentsInChildren;
for (int i = 0; i < array.Length; i++)
{
MeshRenderer meshRenderer = array[i];
Debug.Log(" Mesh renderer: " + meshRenderer);
}
SkinnedMeshRenderer[] componentsInChildren2 = p.GetComponentsInChildren<SkinnedMeshRenderer>();
SkinnedMeshRenderer[] array2 = componentsInChildren2;
for (int j = 0; j < array2.Length; j++)
{
SkinnedMeshRenderer skinnedMeshRenderer = array2[j];
Debug.Log(" Skinned mesh renderer: " + skinnedMeshRenderer);
}
}
示例6: PartHideRecursive
private void PartHideRecursive(VesselElementViewOptions ol, VesselElementViewOption o, Part part)
{
foreach (var r in part.GetComponentsInChildren<Renderer>())
{
r.enabled = false;
}
}
示例7: showOnlyEmittersInList
public static void showOnlyEmittersInList(Part part, List<string> emittersToShow)
{
KSPParticleEmitter[] emitters = part.GetComponentsInChildren<KSPParticleEmitter>();
foreach (KSPParticleEmitter emitter in emitters)
{
emitter.emit = false;
emitter.enabled = false;
if (emittersToShow != null)
{
//If the emitter is on the list then show it
if (emittersToShow.Contains(emitter.name))
{
emitter.emit = true;
emitter.enabled = true;
}
}
}
}