GUIStyle.font 字体

var font : Font

Description描述

The font to use for rendering. If null, the default font for the current GUISkin is used instead.

用于渲染的字体,如果为null,当前的GUISkin的默认字体将被使用。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	void OnGUI() {
		if (GUI.skin.customStyles.Length > 0)
			Debug.Log("Font name: " + GUI.skin.customStyles[0].font.name);

	}
}
// Prints name of the font that customStyles[0] is using
//打印customStyles[0]使用的字体的名字

function OnGUI() {
	if(GUI.skin.customStyles.Length > 0)
		Debug.Log("Font name: " + GUI.skin.customStyles[0].font.name);
}
Page last updated: 2011-1-20