public GUISkin MySkin;
public float x1, x2, x3, x4;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
void OnGUI()
{
GUI.skin = MySkin;
GUI.Button(new Rect(1400.0f / 1627.0f * Screen.width, 60.0f / 915.0f * Screen.height, 150.0f / 1627.0f * Screen.width, 50.0f / 915.0f * Screen.height), "测试" );
GUI.Button(new Rect(x1 / 1627.0f * Screen.width, x2 / 915.0f * Screen.height, 250.0f / 1627.0f * Screen.width, 150.0f / 915.0f * Screen.height), "", "xin2");
}
unity基础开发----GUI实用代码
最新推荐文章于 2022-08-07 21:18:25 发布