Change Texture via script

I want to change texture using only script not inspector for many transitions.

I googling a lot but not work T.T

Texture myTexture;
		
	    myTexture = (Texture)Resources.Load("123.png");
		
		if(myTexture == null)
		{
			Debug.Log("x");
		}
		
		renderer.material.mainTexture = myTexture;

I used this code but myTexture still null after load.

123.png is in assets folder.

When you use Resources.Load, the file must be in a folder named “Resources”.

So first of all place 123.png in a folder called Resources.

Second I’m pretty sure you don’t need the .png, in fact I think you CAN’T have it. Now I may be wrong on this, but try it without the .png after you move it to that folder.