MailItem.cs 803 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using UnityEngine;
  2. using UnityEngine.UI;
  3. using System.Collections;
  4. public class MailItem : ItemRenderer
  5. {
  6. public Text titleTxt;
  7. public Text timeTxt;
  8. public MailPanel mailPanel;
  9. private CallBackUtil.SimpleCallBack clickHandler;
  10. public override object data {
  11. get {
  12. return base.data;
  13. }
  14. set {
  15. base.data = value;
  16. if (data == null)
  17. return;
  18. ChatMsg chatMsg = data as ChatMsg;
  19. switch(chatMsg.categovy)
  20. {
  21. case ChatMsg.Category.Request:
  22. titleTxt.text = Language.GetStr ("MailPanel", "friendRequestTitle").Replace("%NICK%", WWW.UnEscapeURL(chatMsg.content));
  23. clickHandler = FriendRequest;
  24. break;
  25. }
  26. }
  27. }
  28. public void OnClick()
  29. {
  30. if(this.data != null && clickHandler != null)
  31. clickHandler ();
  32. }
  33. private void FriendRequest()
  34. {
  35. }
  36. }