GUISkin
- box
- button
- customStyles
- FindStyle
- font
- GetStyle
- horizontalScrollbarLeftButton
- horizontalScrollbarRightButton
- horizontalScrollbarThumb
- horizontalScrollbar
- horizontalSliderThumb
- horizontalSlider
- label
- scrollView
- settings
- textArea
- textField
- toggle
- verticalScrollbarDownButton
- verticalScrollbarThumb
- verticalScrollbarUpButton
- verticalScrollbar
- verticalSliderThumb
- verticalSlider
- window
GUISkin.FindStyle 查找样式
function FindStyle (styleName : string) : GUIStyle
Description描述
Try to search for a GUIStyle. This functions returns NULL and does not give an error.
试图搜索一个GUIStyle。这个函数返回NULL,不给错误信息。
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
public string aStyleName = "A Style I have";
void OnGUI() {
if (GUI.skin.FindStyle(aStyleName) == null)
Debug.LogWarning("No style named \"" + aStyleName + "\" could be found");
}
}
// Checks if a style name exists
//检查是否存在一个样式名称
var aStyleName : String = "A Style I have";
function OnGUI() {
if(GUI.skin.FindStyle(aStyleName) == null) {
Debug.LogWarning("No style named \"" + aStyleName + "\" could be found");
}
}
最后修改:2011年1月25日 Tuesday 17:56