OnWillRenderObject is called once for each camera if the object is visible.
function OnWillRenderObject() {
// Tint the object red for identification if it is
// being shown on the overhead mini-map view.
if (Camera.current.name == "MiniMapcam") {
renderer.material.color = Color.red;
} else {
renderer.material.color = Color.white;
}
}