ChatItem.cs 495 B

1234567891011121314151617181920212223242526272829
  1. using UnityEngine;
  2. using UnityEngine.UI;
  3. using System.Collections;
  4. public class ChatItem : ItemRenderer
  5. {
  6. public Text titleTxt;
  7. public Text contentTxt;
  8. public Text timeTxt;
  9. public override object data {
  10. get {
  11. return base.data;
  12. }
  13. set {
  14. base.data = value;
  15. if(value != null)
  16. {
  17. ChatMsg chatMsg = value as ChatMsg;
  18. titleTxt.text = UserCache.GetNick (chatMsg.sender);
  19. contentTxt.text = chatMsg.content;
  20. timeTxt.text = chatMsg.GetTimeStr ();
  21. }
  22. }
  23. }
  24. }