public class MeshAndMat : MonoBehaviour {
public Mesh mesh;
private Material mat;
// Use this for initialization
void Start () {
//GetComponent<MeshFilter>().sharedMesh = mesh;
//Debug.Log(GetComponent<MeshFilter>().mesh == mesh);
mat = GetComponent<MeshRenderer>().material;
}
// Update is called once per frame
void Update () {
mat.color = Color.Lerp(mat.color, Color.red, Time.deltaTime);
}
}