using UnityEngine; using System.Collections; public class CyCollision : MonoBehaviour { void OnCollisionEnter(Collision other) { // Debug.Log ("Enter"); // Debug.Log(other.collider); other.collider.GetComponent<MeshRenderer>(). material.color = Color.green; } void OnCollisionStay(Collision other) { // Debug.Log ("Stay"); } void OnCollisionExit(Collision other) { // Debug.Log ("Exit"); other.collider.GetComponent<MeshRenderer>(). material.color = Color.red; } }