unity3d之弹窗
来源:互联网 发布:网络异常是怎么回事 编辑:程序博客网 时间:2024/04/28 08:31
之前对GUI掌握的很差,每次在想实现结束游戏,弹窗操作时都无从下手,今天特意查了下,完成了这个功能。
即通过GUI.Window()
函数原型:
static Rect Window(int id, Rect clientRect, WindowFunction func, string text);
static Rect Window(int id, Rect clientRect, WindowFunction func, Texture image);
代码示例:
using UnityEngine;using System.Collections;public class ExampleClass : MonoBehaviour { public bool doWindow0 = true; void DoWindow0(int windowID) { GUI.Button(new Rect(10, 30, 80, 20), "Click Me!"); } void OnGUI() { if (doWindow0) GUI.Window(0, new Rect(110, 10, 200, 60), DoWindow0, "Basic Window"); }}这段代码实现,弹窗操作时需要对bool变量doWindow0进行判断。
0 0
- unity3d之弹窗
- Unity3D架构之第一弹 《善用接口》
- Unity3d之组件Component
- Unity3D之iOS拍照
- unity3D网络之OnNetworkInstantiate
- unity3d之ui实践
- unity3d之无线发表
- Unity3D之预设
- Unity3D之Lightmap详解
- Unity3D之路
- Unity3D之IOS Document
- Unity3D入门之JavaScript
- Unity3D 之 串行口
- Unity3D之Lightmap详解
- Unity3d之组件Component
- Unity3d之截图方法
- Unity3d之性能优化
- Unity3d之Bug收集
- 读TIJ -2 一切都是对象
- TTS技术简单介绍和Ekho(余音)TTS的安装与编程
- 超文本传输协议
- 编写了一个简单的http代理服务器
- HDU-3016-Man Down
- unity3d之弹窗
- unity3d之打飞机实战
- Oracle default SID list
- 深入理解HTTP协议
- HTTP 协议之压缩
- HTTP协议 - 协议格式
- 安卓开发注意点
- HTTP请求报文和HTTP响应报文
- HTTP协议通信过程汇总