using UnityEngine;
using System.Collections;
public class Test : MonoBehaviour
{
public GameObject testBtn;
public Font f;
// Use this for initialization
void Start()
{
UIEventListener.Get(testBtn).onClick += CreatLabel;
}
// Update is called once per frame
void Update()
{
}
void CreatLabel(GameObject go)
{
UILabel label = NGUITools.AddChild<UILabel>(gameObject);
label.trueTypeFont = f;
label.text = "Test";
}
}
NGUI动态创建UILabel
最新推荐文章于 2019-02-07 17:49:47 发布