http://blog.sina.com.cn/s/blog_66110f6201017rul.html 有时候需要根据用户的权限或者是操作动态设置gui状态上的某些按钮的可用和不可用. 1.先定义一个内表 data: begin of excltab occurs 0, fcode like sy-ucomm, end of excltab. 2.在PBO中中调用STATUS 的时候根据需要设置(这里是禁用SAVE 按钮) refresh…
GUI还可以定义一个窗口,在窗口里面进行控件的添加: using UnityEngine; using System.Collections; public class getbutton : MonoBehaviour { private Rect windowRect; void Start () { windowRect = new Rect(20, 20, 200, 200); } // Update is called once per frame void Update () { }…
GUi:全程是Graphical User Interface,即图形用户界面,就是应用程序提供给用户操作的图形界面,包括窗口.菜单.按钮.工具栏和其它各种图形界面元素.提供了丰富的类,这些类分别位于java.awt和javax.swing包中,简称AWT和Swing AWT:用于创建图形用户界面的一个工具包,它提供了一系列用于实现图形界面的组件.分为两大类:component和MenuComponent.其中MenuComponent是所有与菜单相关的组件的父类,Component则是除菜单外…
1.Label 控件 编写脚本文件,直接绑定在main camera上 public class labelScript : MonoBehaviour { //设定一个值来接收外部赋值的字符串 public string str; //接收外部赋值贴图 public Texture imageTexture; //设定私有变量,只可以在脚本内访问的 private int imageWidth; private int imageHeight; private int screenWidth;…
一.代码: using UnityEngine; using System.Collections; /// <summary> /// 选项卡二 /// </summary> [System.Serializable] public class Item { public Texture icon; public string name;//key name public int amount;//数量 public string itemName; /// <summar…
实现目标: 1.使用个性化Box控件 2.个性化Lable控件 3.添加纵向滚动条 4.新建SelectedItem样式 一.最终效果: 二.主要代码 using UnityEngine; using System.Collections; /// <summary> /// 选项卡二 /// </summary> [System.Serializable] public class Item { public Texture icon; public string name;//…