Image Button Question

Button is

button_star.jpg.

Button image made ​​from will not

Where you need to modify?

using UnityEngine;
using System.Collections;

public class intro_button_img: MonoBehaviour {

public Texture button_star;

void Start () {}

void Update () {}

void OnGUI () {

if (GUI.Button (new Rect (10, 10, 50, 50), button_star));
        
    }
}

Your question is difficult to understand. Here are some suggestions based on what you might be asking:

  • The image must be somewhere in the Assets folder of your project.
  • The script above must be attached to a game object

Select the game object with the script attached in the Hierarchy view. Drag the image from where you placed it in the Assets folder to the button_star variable in the Inspector view in the section that has the same name as your script name.