12345678910111213141516171819202122232425262728293031323334353637 |
- 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);
- }
- }
- }
|