GUI按钮
using UnityEngine;using System.Collections;/// <summary>/// GUI,按钮/// </summary>public class Button : MonoBehaviour { public int x; public int y; public int width; public int height; public string buttonText; // Use this for initializationvoid Start () {}// Update is called once per framevoid Update () {} void OnGUI() { Rect buttonRect = new Rect(Screen.width - x - width,Screen.height - y - height,width,height); if (GUI.Button(buttonRect, buttonText)) { print("click"); } }}