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


C# Collider.GetComponentInChildren方法代码示例

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


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

示例1: MoveToLocation

    // Move to the location of the teleport pad, reset active pad
    void MoveToLocation(Collider _targetLocation)
    {
        Vector3 _targetPosition = _targetLocation.gameObject.transform.position;
        _targetLocation.GetComponentInChildren<ParticleSystem>().Stop();
        _targetLocation.GetComponentInChildren<ParticleSystem>().Clear();

        GameObject.FindGameObjectWithTag("Player").transform.position = _targetPosition;
        active_telepad = null;
    }
开发者ID:youdiaozi,项目名称:kittenvr,代码行数:10,代码来源:Teleport.cs

示例2: OnTriggerEnter

    void OnTriggerEnter(Collider col)
    {
        if (col.GetComponentInChildren<WeaponController>() != null) {

            col.GetComponentInChildren<WeaponController>().SendMessage("GetAmmo", amt);

            GameObject.Destroy(this.gameObject);
        }
    }
开发者ID:Lonswaya,项目名称:LastHumanFPS,代码行数:9,代码来源:AmmoPack.cs

示例3: OnTriggerEnter

 void OnTriggerEnter(Collider col)
 {
     if (!messageGiven) {
         if (col.GetComponentInChildren<tutorialSpeechControl> ()) {
             messageGiven = true;
             col.GetComponentInChildren<tutorialSpeechControl> ().addMessage ("A gun! When I get close enough I can pick it up by clicking on it's icon");
         }
     }
 }
开发者ID:heed13,项目名称:CS-3540-Borderlands,代码行数:9,代码来源:TutDrop1.cs

示例4: OnTriggerExit

    //called when exiting a trigger
    void OnTriggerExit(Collider c) {

        //for exiting posessible triggers
		if (c.GetComponent<Posessable>() != null && c.GetComponentInChildren<ParticleSystem>() != null && !cam.GetComponent<Cam>().visionOn) {//if object is posessable and has particle system
            one = false;//allow possesion of another object
            c.GetComponent<Posessable>().lit = false; //mark this object as unlit
            c.GetComponentInChildren<ParticleSystem>().enableEmission = false; //turn off and clear particle system
            c.GetComponentInChildren<ParticleSystem>().Clear();
        }
    }
开发者ID:JeffreyByJeffrey,项目名称:Ghost,代码行数:11,代码来源:posess.cs

示例5: OnTriggerExit

 void OnTriggerExit(Collider other)
 {
     if (other.CompareTag ("Small")) {
         smallBroInPos = false;
         other.GetComponentInChildren<FireAttackScript>().enabled = true;
     }
     if (other.CompareTag ("Big")) {
         bigBroInPos = false;
         other.GetComponentInChildren<HolderTest>().enabled = true;
     }
 }
开发者ID:Gotyn,项目名称:WHICH,代码行数:11,代码来源:SoccerTriggerScript.cs

示例6: OnTriggerExit

    //Disable player light flickering
    void OnTriggerExit(Collider col)
    {
        if (col.transform.name == "FirstPersonController(Clone)") {
            MicrophoneInput playerInput = col.GetComponentInChildren<MicrophoneInput>();
            if(playerInput != null){
                playerInput.enabled = false;
            }

            Light playerLight = col.GetComponentInChildren<Light>();
            playerLight.intensity = 1.0f;
            playerLight.range = 50f;

        }
    }
开发者ID:jan-rodriguez,项目名称:reverb,代码行数:15,代码来源:MicSwap.cs

示例7: OnTriggerExit

    // Break connection to teleporter or kitten
    void OnTriggerExit(Collider _object)
    {
        if(_object.gameObject.tag.Equals("teleporter"))
        {
            _object.GetComponentInChildren<ParticleSystem>().Stop();
            _object.GetComponentInChildren<ParticleSystem>().Clear();

            active_telepad = null;
        }
        else if (_object.gameObject.tag.Equals("kitten") ||
                 _object.gameObject.tag.Equals("leader"))
        {
            _activeKitten = null;
        }
    }
开发者ID:youdiaozi,项目名称:kittenvr,代码行数:16,代码来源:Teleport.cs

示例8: OnTriggerEnter

 void OnTriggerEnter(Collider c)
 {
     var targetable = c.GetComponentInChildren<TargetableEntityBehaviour>();
     if (targetable is PerkBehaviour) {
         targetable.Dispose();
     }
 }
开发者ID:asdf-systems,项目名称:HappyPenguin,代码行数:7,代码来源:PerkDisposalBehaviour.cs

示例9: OnTriggerEnter

	void OnTriggerEnter(Collider co) {
		// If castle then deal Damage, destroy self
		if (co.name == "PlayerBase") {
			co.GetComponentInChildren<Health>().damage();
			Destroy(gameObject);
		}
	}
开发者ID:ahvdesign,项目名称:Tower-Defense-Q,代码行数:7,代码来源:Monster.cs

示例10: OnTriggerExit

    void OnTriggerExit( Collider other )
    {
        BaseObject bo = other.GetComponentInChildren<BaseObject>();

        if ( bo && bo == sensedObject )
            sensedObject = null;
    }
开发者ID:nosfex,项目名称:aztec_treasure,代码行数:7,代码来源:BaseObjectSensor.cs

示例11: OnTriggerEnter

 void OnTriggerEnter(Collider collider)
 {
     if (collider.tag == "Brick") {
         OTAnimatingSprite sprite = collider.GetComponentInChildren<OTAnimatingSprite>();
         sprite.PlayOnce("Shine");
     }
 }
开发者ID:TorelTwiddler,项目名称:JunglePanic,代码行数:7,代码来源:ShineTrigger.cs

示例12: OnTriggerEnter

 // Use this for initialization
 void OnTriggerEnter(Collider other)
 {
     other.GetComponentInChildren<SoakerGun>().ammo = 600;
     SoundCenter.instance.PlayClipOn(
         SoundCenter.instance.getPowerup,transform.position);
     Destroy(gameObject);
 }
开发者ID:gamkedo-la,项目名称:Foam_Corps,代码行数:8,代码来源:SoakerAmmoBoxScript.cs

示例13: OnTriggerEnter

 void OnTriggerEnter(Collider other)
 {
     if(other.tag == "Player"){
         bUpdate = true;
         playerCam = other.GetComponentInChildren<Camera>().transform;
     }
 }
开发者ID:Jasamus,项目名称:P7_Cathedral,代码行数:7,代码来源:StretchTriggerLookDir.cs

示例14: OnTriggerStay

	void OnTriggerStay(Collider c){
		Posessable p = c.GetComponent<Posessable> ();

		if (p == null) {
			p = c.GetComponentInChildren<Posessable>();
		}

		//print ("in");
		if(p != null){
			if(p.shouldScare && p.posessed){

                Scare s;
                s = c.GetComponent<Scare>();
               
                    if (s == null)
                    {
                        s = c.GetComponentInParent<Scare>();
                    }
                    if (s != null)
                    {
                        if (s.canScareNow() && !s.isGlobal())
                        {
                            NavAgent person = GetComponentInParent<NavAgent>();
                            s.scareLocation(person);
                            s.scarePerson(person);
                            s.resetScareTimer();
                        }
                    }
                
			}
		}

	}
开发者ID:JeffreyByJeffrey,项目名称:Ghost,代码行数:33,代码来源:DetectScary.cs

示例15: OnTriggerExit

 void OnTriggerExit(Collider coll) {
     if (coll.tag == "Interactables") {
         Interactables interact = coll.GetComponentInChildren<Interactables>();
         m_promptText.text = "";
         m_PromptAnimator.SetBool("HasPrompt", false);
     }
 }
开发者ID:hopeforsenegal,项目名称:FToSleep,代码行数:7,代码来源:PlayerInteractionController.cs


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