Unity3D GUI 拖动窗口

using UnityEngine;

using System.Collections;

 

public class Test : MonoBehaviour

{

    public Texture test;

    public Rect rect;

    // Use this for initialization

    void Start()

    {

        rect = new Rect(0, 0, 400, 400);

    }

 

    // Update is called once per frame

    void Update()

    {

 

    }

 

    void OnGUI()

    {

        //GUI.DrawTexture(new Rect(0, 0, 405,397), test);

        rect = GUI.Window(0, rect, DoMyWindow, "Test");

    }

    void DoMyWindow(int windowID)

    {

        GUI.DrawTexture(new Rect(0, 0, 405, 397), test);

        GUI.DragWindow(new Rect(0, 0, 400, 400));

        //

    }

 

}

posted @ 2016-06-26 11:13  Fei非非  阅读(681)  评论(0编辑  收藏  举报