标签:style blog io ar color sp for on div
using UnityEngine; using System.Collections; public class Userwords : MonoBehaviour { private UIInput input; public UITextList textlist; void Start () { } void Update () { } void Awake() { input=this.GetComponent<UIInput>(); GameObject grid1=GameObject.Find("ChatSendBg");//获取需要监听的按钮对象 UIEventListener.Get(grid1).onClick=OnClickBtn;//设置这个按钮的监听,指向本类的OnClickBtn方法中 } void OnClickBtn(GameObject go) { switch(go.name) { case "ChatSendBg": input.value=this.transform.GetComponentInChildren<UILabel>().text; string chatMessage=input.value; textlist.Add(chatMessage); input.value=""; break; } } }
标签:style blog io ar color sp for on div
原文地址:http://www.cnblogs.com/heisaijuzhen/p/4126177.html