Text not reverting back to original properties after gameplay

I have no idea why this is happening but for some reason, after changing the alpha value to zero of the text material colour during gameplay, the alpha value does not revert back after I click the stop button. The alpha value remains 0. Here is the code i am doing:

     IEnumerator Fade(){
	    for (float alpha = 1; alpha > 0; alpha -= (Time.deltaTime * fadeSpeed)) {
		Color color = gameObject.GetComponent<Text>().material.color;
		color.a = alpha;
		gameObject.GetComponent<Text>().material.color = color;
		yield return null;


Any suggestions on why this is happening?

This is probably because, unlike MeshRenderer.material, Text.material does not make a copy of the material before editing it. So if the material of the Text component is an asset, changing its properties in play mode will edit the asset directly rather than a copy that will cease to exist when play mode is exited.

One quick solution is to manually make a copy of the material when in the editor; try sticking this in the Start() method of the same script:

GetComponent<Text>().material = new Material(GetComponent<Text>().material);