`

unity基础开发----GUI实用代码

 
阅读更多
 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");
    }

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics