本文整理汇总了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;
}
示例2: OnTriggerEnter
void OnTriggerEnter(Collider col)
{
if (col.GetComponentInChildren<WeaponController>() != null) {
col.GetComponentInChildren<WeaponController>().SendMessage("GetAmmo", amt);
GameObject.Destroy(this.gameObject);
}
}
示例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");
}
}
}
示例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();
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例8: OnTriggerEnter
void OnTriggerEnter(Collider c)
{
var targetable = c.GetComponentInChildren<TargetableEntityBehaviour>();
if (targetable is PerkBehaviour) {
targetable.Dispose();
}
}
示例9: OnTriggerEnter
void OnTriggerEnter(Collider co) {
// If castle then deal Damage, destroy self
if (co.name == "PlayerBase") {
co.GetComponentInChildren<Health>().damage();
Destroy(gameObject);
}
}
示例10: OnTriggerExit
void OnTriggerExit( Collider other )
{
BaseObject bo = other.GetComponentInChildren<BaseObject>();
if ( bo && bo == sensedObject )
sensedObject = null;
}
示例11: OnTriggerEnter
void OnTriggerEnter(Collider collider)
{
if (collider.tag == "Brick") {
OTAnimatingSprite sprite = collider.GetComponentInChildren<OTAnimatingSprite>();
sprite.PlayOnce("Shine");
}
}
示例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);
}
示例13: OnTriggerEnter
void OnTriggerEnter(Collider other)
{
if(other.tag == "Player"){
bUpdate = true;
playerCam = other.GetComponentInChildren<Camera>().transform;
}
}
示例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();
}
}
}
}
}
示例15: OnTriggerExit
void OnTriggerExit(Collider coll) {
if (coll.tag == "Interactables") {
Interactables interact = coll.GetComponentInChildren<Interactables>();
m_promptText.text = "";
m_PromptAnimator.SetBool("HasPrompt", false);
}
}