Property guiTexture has been deprecated . Use GetComponent()

using UnityEngine;
using System.Collections;

public class ButtonOK : MonoBehaviour {

public string loadSceneName;    //Next load scene name

public Texture2D buttonOkNormal;  //Texture button normal
public Texture2D buttonOkDown;   //Texture button down
public Entername enterNameScript;  //script entername
public SelectCharacter selectCharacterScript; //script select character
public AudioClip sfxButton;  //sound effect when click this button

void OnMouseUp()
{
    //change texture to "normal"
    this.gameObject.guiTexture.texture = buttonOkNormal;
	
	//Save select character and name
	PlayerPrefs.SetString("pName",enterNameScript.defaultName);
	PlayerPrefs.SetInt("pSelect",selectCharacterScript.indexHero);
	
	SpawnPointHero.enableLoadData = true;
	
	//Load next scene
	Invoke("LoadScene",0.1f);
}

void OnMouseDown()
{
    //change texture to "down"
    this.gameObject.guiTexture.texture = buttonOkDown;
	
	//Play sfx
	if(sfxButton != null)
	AudioSource.PlayClipAtPoint(sfxButton,transform.position);
	
}

void LoadScene()
{
	Application.LoadLevel(loadSceneName);;	
}

}

The error is telling you that you can not use .guiTexture to refer to that object any more. The shortcut has been removed and now you must access it using GetComponent, just like any other component.

So it’ll be something like this :

gameObject.GetComponent<GUITexture>().texture

You’ll get an error unless you do something with it though.

One way or another you need make it equal something.

  1. Store it in a variable

    GUITexture myGT = gameObject.GetComponent();
    myGT.texture = someTexture2D;

  2. Use it instantaneously

    gameObject.GetComponent().texture = someTexture2D;