首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

GUI旋钮

2012-12-25 
GUI按钮using UnityEngineusing System.Collections/// summary/// GUI,按钮/// /summarypublic cla

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");        }    }}

热点排行