ContactPoint.thisCollider 第一个碰撞器

var thisCollider : Collider

Description描述

The first collider in contact.

第一个接触的碰撞器。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	void OnCollisionEnter(Collision other) {
		print("This collider is named: " + other.contacts[0].thisCollider.name);
	}
}
// Prints the name of this collider
//打印第一个碰撞器的名字
function OnCollisionEnter(other : Collision) {
print("This collider is named: " + other.contacts[0].thisCollider.name);
}
Page last updated: 2011-1-7