function OnCollisionEnter (collision : Collision) {
//when the block have 4 objects touching the collision...
if (collision.gameObject == 4)
renderer.enabled = true;
//the block will be visible or unvisible (rendered mesh or unrendered mesh)
else (collision.gameObject < 4)
renderer.enabled = false;
}
↧