首页 > 代码库 > 王立平--Unity中的GUI Skin

王立平--Unity中的GUI Skin

C#脚本:

public class NewBehaviourScript2 : MonoBehaviour {
public Texture t;
public GUISkin skin;
// Use this for initialization
void Start () {

}
 void OnGUI(){
GUILayout.BeginArea(new Rect(0, 0, Screen.width, Screen.height)); 
GUI.skin = skin;
GUILayout.Button ("haha");

GUILayout.EndArea();
 
}
}
设置:
1.create->GUI Skin


2.设置属性


3.运行显示效果


王立平--Unity中的GUI Skin