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


C# Collider.GetComponentInChildren方法代码示例

本文整理汇总了C#中UnityEngine.Collider.GetComponentInChildren方法的典型用法代码示例。如果您正苦于以下问题:C# Collider.GetComponentInChildren方法的具体用法?C# Collider.GetComponentInChildren怎么用?C# Collider.GetComponentInChildren使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UnityEngine.Collider的用法示例。


在下文中一共展示了Collider.GetComponentInChildren方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnTriggerStay

 void OnTriggerStay(Collider other)
 {
     if (other.gameObject.tag == "Player")
     {
         other.GetComponentInChildren<PlayerShooting>().BounceTimer = 0;
         Destroy(gameObject, 1);
     }
 }
开发者ID:csethanhcong,项目名称:game3d-unity,代码行数:8,代码来源:BounceBulletItem.cs

示例2: OnTriggerEnter

        void OnTriggerEnter(Collider other)
        {
            // If the entering collider is the player...
            if (other.tag == "Player")
            {
                PlayerShooting playerShooting = other.GetComponentInChildren<PlayerShooting>();

                if (playerShooting != null)
                {
                    playerShooting.AddAmmo(ARTIFACT_AMOUNT);
                    Destroy(gameObject);
                }
            }
        }
开发者ID:gilgulim,项目名称:KillThemAllUnity_Version2,代码行数:14,代码来源:AmmoCollected.cs

示例3: OnTriggerEnter

        void OnTriggerEnter(Collider other)
        {
            if (other.CompareTag("Player1_") || other.CompareTag("Player2_") || other.CompareTag("Player3_") || other.CompareTag("Player4_"))
            {
                ShipPartDestroy partScript = other.GetComponentInParent<ShipPartDestroy>();
                if (partScript != null)
                {
                    // Found in parent, repair
                    partScript.RepairAllParts();
                }
                else
                {
                    // Look to children for the part object
                    partScript = other.GetComponentInChildren<ShipPartDestroy>();
                    if (partScript != null)
                    {
                        partScript.RepairAllParts();
                    }
                }

            }
        }
开发者ID:patferguson,项目名称:Storms-Project,代码行数:22,代码来源:HealPointBehaviour.cs

示例4: OnTriggerExit

 	void OnTriggerExit(Collider other) {
     Text text = other.GetComponentInChildren<Text> ();
     if (text == null) { return; }
     text.color = textColor;
 	}
开发者ID:fufu70,项目名称:knighthacksoculeap,代码行数:5,代码来源:HilightTextVolume.cs

示例5: OnTriggerStay

 	void OnTriggerStay(Collider other){
 		Text text = other.GetComponentInChildren<Text>();
     if (text == null) { return; }
 		text.color = Color.white;
 		CurrentHilightValue = text.text;
 	}
开发者ID:fufu70,项目名称:knighthacksoculeap,代码行数:6,代码来源:HilightTextVolume.cs

示例6: OnTriggerEnter

   void OnTriggerEnter(Collider other) {
     // TODO: There should be no need for a collider on labels to derive a highlight.
 		Text text = other.GetComponentInChildren<Text>();
     if (text == null) { return; }
 		text.color = Color.white;
 	}
开发者ID:fufu70,项目名称:knighthacksoculeap,代码行数:6,代码来源:HilightTextVolume.cs


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