Make a button Without using GUI.

Unity’s GUI system is okay, but I strongly dislike the way it handles GUI skins etc. What is the best way to create a button with just only a texture. Thanks in advance for any help!

If you want a 3D button, use a box or plane, or get NGUI.

Create a game object that has a collider (for example, a cube with a Box Collider), and apply a material with a texture. If you want it to always face the camera, then create and attach a script that contains (examples below use C#):

void Update() {
    transform.LookAt(Camera.main.transform);
}

You might want to play around with the LookAt() line depending on your needs.

In your user input script, add code like this:

void Update() {
    // Check if mouse button was pressed down.
    if (Input.GetMouseButtonDown(0)) {

        // Run a raycast to see if the mouse is over a collider.
        Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
        RaycastHit hit;
        if (Physics.Raycast(ray, out hit)) {

            // Clicked on hit.collider; do something here.
        }
    }
}

You could get fancier by making the box do something when Input.GetMouseButtonDown is true (like changing tint, playing a sound, etc), and then something else when Input.GetMouseButtonUp is true over the box (e.g., change tint back, player another sound, take some action, etc.).

The solution above will work, but good GUIs are a lot of work. I prefer to use NGUI, and the author is now working for Unity, so that may be a hint about Unity GUI’s direction.

Then again, at Unite 11, Ryan Hipple of Schell Games did a good presentation on ScriptableObjects and Unity GUI that softened my stance against Unity GUI. I recommend fast-forwarding the presentation to 38:00 (or 31:45 if you need to brush up on ScriptableObjects):

http://video.unity3d.com/video/3708530/unite-11-scaleable-game