ControllerColliderHit.collider 碰撞器

var collider : Collider

Description描述

The collider that was hit by the controller

由控制器碰到的碰撞器。

using UnityEngine;

using System.Collections;



public class example : MonoBehaviour {

	void OnControllerColliderHit(ControllerColliderHit hit) {

		hit.collider.renderer.material.color = Color.red;

	}

}
// Paint red the collider we hit.

//我们碰到的碰撞绘制红色

function OnControllerColliderHit(hit : ControllerColliderHit) {

	hit.collider.renderer.material.color = Color.red;

}
Page last updated: 2010-12-23