UILabel label = NGUITools.AddChild<UILabel>(parent);
if (null != mCommonFont) label.font = mCommonFont;
label.font = mCommonFont;
label.transform.localScale = new Vector3(24.00f, 24.00f, 1.00f);
label.effectStyle = UILabel.Effect.Outline;
label.effectColor = new Color(0.00f, 0.00f, 0.00f);
label.pivot = UILabel.Pivot.Left;
label.transform.gameObject.AddComponent<BoxCollider>();
label.GetComponent<BoxCollider>().size = new Vector3(380.00f, 32.00f, 1.0f);
label.transform.gameObject.AddComponent<UIDragPanelContents>();
从脚本加载字体:
mCommonFont = Resources.Load("Chinese", typeof(UIFont)) as UIFont;