unity的GUI

来源:互联网 发布:房产系统源码 编辑:程序博客网 时间:2024/06/05 20:12
using UnityEngine;
using System.Collections;
using UnityEngine.UI;


public class scene : MonoBehaviour {
    public Texture puic;
    float a = 0;
    bool bl = false;


    public void wfun(int id)
    {
    }
void Start () {

}

void Update () {
       
}
    void OnGUI() 
    {
        //GUI.DrawTexture(new Rect(10,10, 800, 600), puic);
        //Debug.Log("123!");
        // GUILayout.Button("新的");
       // GUI.Button(new Rect(400, 400, 100, 50), "确定");
        // GUI.Box(new Rect(0,0,Screen.width,Screen.height),"盒子");
        //委托 取反!
        if (GUI.Button(new Rect(100, 100, 100, 60), "确定"))
        {
            Debug.Log("123!");
            bl = !bl;
          
        }
        if (bl)
        {
            GUI.Window(1, new Rect(Input.mousePosition.x,Screen.height- Input.mousePosition.y, 300, 250), wfun, "witndow");
            // GUI.WindowFunction
        }
        
        GUI.HorizontalSlider(new Rect(25,25,100,30),a,0.0f,10.0f);
       


       
     


    }
    
   




}
0 0
原创粉丝点击