Changing the texture on an object with a trigger.

I wondered if there was a simple way to change the texture on an already textured object using a trigger?

With something similar to this which has worked with playing animation with an invisible trigger, but how do I code to change the texture once the trigger has been activated?

 function OnControllerColliderHit (hit : ControllerColliderHit)
if (hit.gameObject.tag == "Cube")

Getmaterial.object == "From File)

The Get material is only a guess, but does anyone have an answer?

Crate an folder named "Resources" in your assets.(If you don't have one) Put your texture in that folder. (For example "TextureName.png") And call this on the trigger:

renderer.material.mainTexture = Resources.Load("TextureName");