文章图片
void OnGUI() {
GUI.Label(Rect(1,1,100,20),"I'm a Label");
//1
GUI.Box(Rect(1,21,100,20),"I'm a Box");
//2
GUI.Button(Rect(1,41,100,20),"I'm a Button");
//3
GUI.RepeatButton(Rect(1,61,120,20),"I'm a RepeatButton");
//4
GUI.TextField(Rect(1,81,100,20),"I'm a TextFielld");
//5
GUI.TextArea(Rect(1,101,100,40),"I'm a TextArea,\nMultiline");
//6
【unity|Unity3D中基本GUI控件介绍】GUI.Toggle(Rect(1,141,120,20),true,"I'm a Toggle true");
//7
GUI.Toggle(Rect(1,161,120,20),false,"I'm a Toggle false");
//8
GUI.Toolbar(Rect(1,181,160,20),-1,["Toolbar","Tool2","Tool3"]);
//9
GUI.SelectionGrid(Rect(1,201,190,20),2,["Selection","Grid","select3"],3);
//10
GUI.HorizontalSlider(Rect(1,221,180,20),3.0,0,10.0);
//11
GUI.VerticalScrollbar(Rect(1,241,20,100),3.0,1,0.0,10.0);
//12
//13
GUI.BeginScrollView (Rect (200,10,100,100),Vector2.zero, Rect (0, 0, 220,200));
GUI.Label(Rect(0,0,100,20),"I'm a Label");
GUI.EndScrollView();
//14
GUI.Window(0,Rect(200,129,100,100),funcwin,"window");
}
推荐阅读
- C#|C# / VB.NET 将Html转为Word
- 嵌入式开发|STM32人脸识别系统设计(程序代码+论文)
- Unity|Unity C# 网络学习(十一)——自定义协议生成工具
- Unity3d-2019.4-简易红绿灯
- unity|Unity3D协程详解
- C#|C# Any()和AII()方法
- Unity功能|Unity之UGUI-特效遮挡问题2.0
- #|向上转型和向下转型
- 经验之谈|C#中using关键字的作用及其用法