如下
using UnityEngine;
using System.Collections;
public class Test : MonoBehaviour {
UILabel uiLabel;
public UIFont font1;
public Font font2;
// Use this for initialization
void Start () {
// 获得 UILabel
uiLabel = GetComponent<UILabel>();
// 位图的读取
// uiLabel.bitmapFont = font1;
//动态加载
获取字体
//GameObject fontobj = Resources.Load("XXX/New Font") as GameObject;
//UIFont font = fontobj.GetComponent<UIFont>();
修改字体
//uiLabel.bitmapFont = font;
// 矢量图的读取
修改字体
// uiLabel.trueTypeFont = font2;
// 动态加载
//Font font_test = Resources.Load("XXX/XXXFont") as Font;
//uiLabel.trueTypeFont = font_test;
}
}