CommentItem.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. using UnityEngine;
  2. using UnityEngine.UI;
  3. using System.Collections;
  4. using System.Collections.Generic;
  5. public class CommentItem : Regist
  6. {
  7. public Text Tit;
  8. public Text ContentLab;
  9. public Text VisitLab;
  10. public Button VisitBtn;
  11. public string Content;
  12. public string SerialNumber;
  13. public override bool RegistImmed()
  14. {
  15. if (base.RegistImmed())
  16. {
  17. return true;
  18. }
  19. Dictionary<string, Transform> childDic = new Dictionary<string, Transform>();
  20. Auxiliary.CompileDic(transform, childDic);
  21. Tit = childDic["Tit"].GetComponent<Text>();
  22. VisitLab = childDic["VisitLab"].GetComponent<Text>();
  23. VisitBtn = childDic["VisitBtn"].GetComponent<Button>();
  24. ContentLab = childDic["ContentLab"].GetComponent<Text>();
  25. VisitLab.text = ManaReso.Get<Text>("C_CostLab").text;
  26. VisitBtn.onClick.AddListener(Visit);
  27. ManaCenter.OnLevelChange += () =>
  28. {
  29. VisitLab.text = ManaReso.Get<Text>("C_CostLab").text;
  30. };
  31. return false;
  32. }
  33. public void Visit()
  34. {
  35. }
  36. public void Reset(string serialNumber, string content)
  37. {
  38. Content = content;
  39. SerialNumber = serialNumber;
  40. Tit.text = "****" + serialNumber.Substring(serialNumber.Length-4);
  41. ContentLab.text = content;
  42. }
  43. }