本文整理汇总了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());
}
}
示例2: ColliderHit
void ColliderHit(Collider other)
{
if (isAttacking) {
other.SendMessageUpwards("ReceiveDamage",5);
Debug.Log("I Hit You");
}
}
示例3: OnTriggerEnter
void OnTriggerEnter(Collider col)
{
if (col.isTrigger != true && col.CompareTag("Enemy"))
{
col.SendMessageUpwards("Damage", dmg);
}
}
示例4: OnTriggerEnter
void OnTriggerEnter(Collider other){
if (hasAuthority) {
itemInfo.itemAmmo = ammoCount;
itemInfo.itemIndex = itemIndex;
other.SendMessageUpwards("GiveItem",itemInfo,SendMessageOptions.DontRequireReceiver);
}
}
示例5: OnTriggerEnter
void OnTriggerEnter(Collider col)
{
if(col.tag == playerTag)
{
PickupProperties pickupProperties = new PickupProperties(type, value);
col.SendMessageUpwards("OnPickUp", pickupProperties);
Destroy(gameObject);
}
}
示例6: OnTriggerEnter
void OnTriggerEnter(Collider other)
{
if (other.CompareTag("Player"))
{
other.SendMessageUpwards("Medic", hitPoints, SendMessageOptions.DontRequireReceiver);
AudioSource.PlayClipAtPoint(sound, transform.position);
Destroy(gameObject);
}
}
示例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");
}
}
示例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);
}
}
示例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;
}
}
示例10: OnTriggerEnter
public void OnTriggerEnter(Collider collider)
{
collider.SendMessageUpwards("OnViewerNearby", SendMessageOptions.DontRequireReceiver);
}
示例11: OnTriggerExit
public void OnTriggerExit(Collider collider)
{
collider.SendMessageUpwards("OnViewerFarAway", SendMessageOptions.DontRequireReceiver);
}
示例12: doDotDmg
void doDotDmg(Collider hit)
{
hit.SendMessageUpwards ("ApplyDotDamage",creationTime, SendMessageOptions.DontRequireReceiver);
}
示例13: AttackColliderHit
void AttackColliderHit(Collider other)
{
if (avatarAttacking) {
other.SendMessageUpwards("ReceiveDamage", 5);
}
}