Unity3D单击物体弹出GUI窗口
2013-10-14 11:10
465 查看
功能:
1.显示视窗及关闭视窗功能
2.单击物体弹出GUI窗口
view plaincopy to clipboardprint?
1. static var WindowSwitch : boolean = false;
2. var mySkin : GUISkin;
3. var windowRect = Rect (200, 80, 240, 100);
4. function OnGUI ()
5. {
6. if(WindowSwitch == true)
7. {
8. GUI.skin = mySkin;
9. windowRect = GUI.Window (0, windowRect, WindowContain, "测试视窗");
10. }
11. }
12. function WindowContain (windowID : int)
13. {
14. if (GUI.Button (Rect (70,40,100,20), "关闭视窗"))
15. {
16. WindowSwitch = false;
17. }
18. }
static var WindowSwitch : boolean = false; var mySkin : GUISkin; var windowRect = Rect (200, 80, 240, 100); function OnGUI () { if(WindowSwitch == true) { GUI.skin = mySkin; windowRect = GUI.Window (0, windowRect, WindowContain, "测试视窗"); } } function WindowContain
(windowID : int) { if (GUI.Button (Rect (70,40,100,20), "关闭视窗")) { WindowSwitch = false; } }
view plaincopy to clipboardprint?
1. function OnMouseEnter ()
2. {
3. renderer.material.color = Color.red;
4. }
5. function OnMouseDown ()
6. {
7. Func_GUIWindow.WindowSwitch = true;
8. }
9. function OnMouseExit ()
10. {
11. renderer.material.color = Color.white;
12. }
1.显示视窗及关闭视窗功能
2.单击物体弹出GUI窗口
view plaincopy to clipboardprint?
1. static var WindowSwitch : boolean = false;
2. var mySkin : GUISkin;
3. var windowRect = Rect (200, 80, 240, 100);
4. function OnGUI ()
5. {
6. if(WindowSwitch == true)
7. {
8. GUI.skin = mySkin;
9. windowRect = GUI.Window (0, windowRect, WindowContain, "测试视窗");
10. }
11. }
12. function WindowContain (windowID : int)
13. {
14. if (GUI.Button (Rect (70,40,100,20), "关闭视窗"))
15. {
16. WindowSwitch = false;
17. }
18. }
static var WindowSwitch : boolean = false; var mySkin : GUISkin; var windowRect = Rect (200, 80, 240, 100); function OnGUI () { if(WindowSwitch == true) { GUI.skin = mySkin; windowRect = GUI.Window (0, windowRect, WindowContain, "测试视窗"); } } function WindowContain
(windowID : int) { if (GUI.Button (Rect (70,40,100,20), "关闭视窗")) { WindowSwitch = false; } }
view plaincopy to clipboardprint?
1. function OnMouseEnter ()
2. {
3. renderer.material.color = Color.red;
4. }
5. function OnMouseDown ()
6. {
7. Func_GUIWindow.WindowSwitch = true;
8. }
9. function OnMouseExit ()
10. {
11. renderer.material.color = Color.white;
12. }
相关文章推荐
- Unity3D单击物体弹出GUI窗口
- 单击物体弹出GUI窗口,很常用的功能!
- Unity3D 使用NGUI制作简易弹出窗口声音控制器
- 根据两个物体的距离来弹出窗口
- 关于layer.open弹出层单击事件如何调用父窗口方法的说明
- 单击浏览器右上角的X关闭窗口弹出提示的小例子
- jQuery实现单击弹出Div层窗口效果(可关闭可拖动)
- Flex在窗口之外单击关闭弹出窗口的方法
- Unity3D GUI菜单弹出隐藏的效果
- 单击浏览器右上角的X关闭窗口弹出提示的小例子
- javascript 父页面单击按钮,弹出窗口,接受用户输入,关闭当前弹出窗口,返回父页面
- jQuery实现单击弹出Div层窗口效果(可关闭可拖动)
- gridview鼠标经过某行改变样式、颜色并且单击弹出窗口
- JS实现单击按钮后弹出新的窗口页面
- 单击页面按钮,弹出浮动窗口的两种方法
- WPF—QQ界面(四):单击QQ昵称弹出个人简介窗口的效果实现
- Unity3D Editor 编辑器扩展2 选取物体、撤销操作和窗口小部件的显示
- 按钮单击ThickBox弹出窗口
- 点击立方体弹出GUI窗口
- asp.net 弹出窗口 单击确定和取消跳转到指定页面