using UnityEngine; using UnityEngine.UI; using System.Collections; public class ChatBarChatItem : ItemRenderer { public Text nameTxt; public Text contentTxt; public Text timeTxt; public override object data { get { return base.data; } set { base.data = value; if(value is Follower) { Follower follower = value as Follower; nameTxt.text = UserCache.GetNick (follower.userId); contentTxt.text = follower.GetLastMsg (); timeTxt.text = follower.GetLastMsgTime (); } } } public void OnClick() { if(data is Follower) { Follower follower = data as Follower; ChatPanel.ShowChat (follower.userId); } } }