dynamically changing texture of an object

I’m trying to make a GUI button that provides me change the texture of a GameObject… Any ideas?

I tried to use this code, but somehow when I click on button the sphere turns white, no texture…

using UnityEngine;
using System.Collections;

namespace Vuforia
{
	public class GUI_Button : MonoBehaviour 
	{
		GameObject Pokeball;
		Texture3D texture = (Texture3D) Resources.Load ("Resources/clouds1024");

		private void OnGUI() 
		{
			if (GUI.Button (new Rect (5, 15, 100, 25), "Pokebola")) {
				Pokeball = GameObject.Find("Pokeball");

				Pokeball.GetComponent<Renderer>().material.mainTexture = texture;
			
			}
		}
	}
}

Resources.Load already looking inside Resources folder so your Texture was null (unless you’ve another Resources folder inside Resources)

    GameObject Pokeball;
	Texture2D texture;
	void Start(){
		texture = (Texture2D) Resources.Load ("clouds1024");
            Pokeball = GameObject.Find("Pokeball");
	}
		private void OnGUI() 
		{
			if (GUI.Button (new Rect (5, 15, 100, 25), "Pokebola")) {
				
				Pokeball.GetComponent<Renderer>().material.mainTexture = texture;
				
			}
		}
	}

Texture2D, not 3D?