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


C# Collider.SendMessageUpwards方法代码示例

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


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

示例1: OnTriggerEnter

    void OnTriggerEnter(Collider other)
    {
        if (other.CompareTag("Enemy"))
        {
            other.SendMessageUpwards("ApplyDamage", hitPoints, SendMessageOptions.DontRequireReceiver);
            StartCoroutine(Explosion());
        }

        if (other.CompareTag("Player"))
        {
            other.SendMessageUpwards("PlayerDamage", hitPoints, SendMessageOptions.DontRequireReceiver);
            StartCoroutine(Explosion());
        }
    }
开发者ID:jsmulikow664,项目名称:Zombie-Slaughter-FPS,代码行数:14,代码来源:LandMineDamage.cs

示例2: ColliderHit

 void ColliderHit(Collider other)
 {
     if (isAttacking) {
         other.SendMessageUpwards("ReceiveDamage",5);
         Debug.Log("I Hit You");
     }
 }
开发者ID:Raysangar,项目名称:MasksPrototype,代码行数:7,代码来源:PlayerControllerIso.cs

示例3: OnTriggerEnter

 void OnTriggerEnter(Collider col)
 {
     if (col.isTrigger != true && col.CompareTag("Enemy"))
     {
         col.SendMessageUpwards("Damage", dmg);
     }
 }
开发者ID:supiera,项目名称:_Team,代码行数:7,代码来源:AttackTrigger.cs

示例4: OnTriggerEnter

	void OnTriggerEnter(Collider other){
		if (hasAuthority) {
			itemInfo.itemAmmo = ammoCount;
			itemInfo.itemIndex = itemIndex;
			other.SendMessageUpwards("GiveItem",itemInfo,SendMessageOptions.DontRequireReceiver);
		}
	}
开发者ID:omgware,项目名称:UnityUnetMovement,代码行数:7,代码来源:PickupScript.cs

示例5: OnTriggerEnter

 void OnTriggerEnter(Collider col)
 {
     if(col.tag == playerTag)
     {
         PickupProperties pickupProperties = new PickupProperties(type, value);
         col.SendMessageUpwards("OnPickUp", pickupProperties);
         Destroy(gameObject);
     }
 }
开发者ID:haykath,项目名称:Unity-Runner-Final,代码行数:9,代码来源:PickupObject.cs

示例6: OnTriggerEnter

 void OnTriggerEnter(Collider other)
 {
     if (other.CompareTag("Player"))
     {
         other.SendMessageUpwards("Medic", hitPoints, SendMessageOptions.DontRequireReceiver);
         AudioSource.PlayClipAtPoint(sound, transform.position);
         Destroy(gameObject);
     }
 }
开发者ID:jsmulikow664,项目名称:Zombie-Slaughter-FPS,代码行数:9,代码来源:Medic.cs

示例7: OnTriggerEnter

    void OnTriggerEnter(Collider collider)
    {
        if (collider.name == "Satellite") {
            Destroy(collider.gameObject);
        }

        if (collider.attachedRigidbody.name.Contains("Hover")) {
            collider.attachedRigidbody.isKinematic = true;
            collider.SendMessageUpwards("Fall");
        }
    }
开发者ID:ajanzen,项目名称:minibump,代码行数:11,代码来源:BlackHole.cs

示例8: OnTriggerEnter

    void OnTriggerEnter(Collider other)
    {
        if(other.tag == "Taxi"){
            other.SendMessageUpwards ("ReverseCar");
        }
        if(other.tag == "Stranger"){
            Destroy(other.gameObject);
            Instantiate(Stranger, Spawn.transform.position, Spawn.transform.rotation);
        }

        if(other.tag == "StrangerLeft"){
            Destroy(other.gameObject);
            Instantiate(StrangerLeft, leftSpawn.transform.position, leftSpawn.transform.rotation);
        }
    }
开发者ID:dangd169,项目名称:shakeitoff,代码行数:15,代码来源:endZone.cs

示例9: OnTriggerEnter

 void OnTriggerEnter(Collider other)
 {
     if(other.CompareTag("Laser")){
         return;
     }
     //If it was shot from the player's cannon
     if (!isEnemy && !other.CompareTag ("Gun")) {
         other.gameObject.SendMessage ("Death");
         GameObject particles = (GameObject)Instantiate (collisionEffect, transform.position, transform.rotation);
         particles.transform.parent = particleGrouper.transform;
         Destroy (gameObject);
         return;
     }
     //IF it was an enemy shot
         else if (isEnemy && !other.CompareTag("Enemy")) {
         other.SendMessageUpwards("HitByLaser");
         Destroy (gameObject);
         return;
     }
 }
开发者ID:flinan,项目名称:FalconEscape,代码行数:20,代码来源:Laser.cs

示例10: OnTriggerEnter

 public void OnTriggerEnter(Collider collider)
 {
     collider.SendMessageUpwards("OnViewerNearby", SendMessageOptions.DontRequireReceiver);
 }
开发者ID:Waigo21,项目名称:GamePrototypes,代码行数:4,代码来源:Viewer.cs

示例11: OnTriggerExit

 public void OnTriggerExit(Collider collider)
 {
     collider.SendMessageUpwards("OnViewerFarAway", SendMessageOptions.DontRequireReceiver);
 }
开发者ID:Waigo21,项目名称:GamePrototypes,代码行数:4,代码来源:Viewer.cs

示例12: doDotDmg

 void doDotDmg(Collider hit)
 {
     hit.SendMessageUpwards ("ApplyDotDamage",creationTime, SendMessageOptions.DontRequireReceiver);
 }
开发者ID:Buhlaine,项目名称:MarsInitiative,代码行数:4,代码来源:grenadeExplosionScript.cs

示例13: AttackColliderHit

 void AttackColliderHit(Collider other)
 {
     if (avatarAttacking) {
         other.SendMessageUpwards("ReceiveDamage", 5);
     }
 }
开发者ID:Raysangar,项目名称:MasksPrototype,代码行数:6,代码来源:AvatarAttackController.cs


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