当前位置: 首页>>代码示例>>C#>>正文


C# Part.GetComponentsInChildren方法代码示例

本文整理汇总了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;
        }
开发者ID:hashashin,项目名称:CactEye,代码行数:15,代码来源:WrapperHullcam.cs

示例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;
 }
开发者ID:shadowmage45,项目名称:SSTULabs,代码行数:13,代码来源:SSTUModInterop.cs

示例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("-------------------------------------------------------------------------");
 }
开发者ID:shadowmage45,项目名称:SSTULabs,代码行数:19,代码来源:SSTUModInterop.cs

示例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;
     }
 }
开发者ID:EdwardWongHau,项目名称:ksp-kronalutils,代码行数:8,代码来源:VesselViewConfig.cs

示例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);
     }
 }
开发者ID:Charon77,项目名称:FreeIVA,代码行数:27,代码来源:Utils.cs

示例6: PartHideRecursive

 private void PartHideRecursive(VesselElementViewOptions ol, VesselElementViewOption o, Part part)
 {
     foreach (var r in part.GetComponentsInChildren<Renderer>())
     {
         r.enabled = false;
     }
 }
开发者ID:bigorangemachine,项目名称:ksp-kronalutils,代码行数:7,代码来源:VesselViewConfig.cs

示例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;
                    }
                }
            }
        }
开发者ID:Bear67,项目名称:WildBlueTools,代码行数:20,代码来源:Utils.cs


注:本文中的Part.GetComponentsInChildren方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。