Unity3D GUI 拖动窗口

Posted Fei非非

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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));

        //

    }

 

}

以上是关于Unity3D GUI 拖动窗口的主要内容,如果未能解决你的问题,请参考以下文章