HeroAttributeWidget.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. using Core.Language;
  2. namespace Fort23.Mono
  3. {
  4. public class HeroAttributeData
  5. {
  6. public string name;
  7. public string currentValue;
  8. public string nextValue;
  9. public HeroAttributeData(string name, string currentValue, string nextValue)
  10. {
  11. this.name = name;
  12. this.currentValue = currentValue;
  13. this.nextValue = nextValue;
  14. }
  15. public HeroAttributeData(int name, string currentValue, string nextValue)
  16. {
  17. this.name = LanguageManager.Instance.Text(name);
  18. this.currentValue = currentValue;
  19. this.nextValue = nextValue;
  20. }
  21. }
  22. [UIBinding(prefab = "HeroAttributeWidget")]
  23. public partial class HeroAttributeWidget : ItemWidgetBasic
  24. {
  25. public int lanID;
  26. private void Init()
  27. {
  28. }
  29. public override void AddEvent()
  30. {
  31. }
  32. public override void DelEvent()
  33. {
  34. }
  35. public override void AddButtonEvent()
  36. {
  37. base.AddButtonEvent();
  38. }
  39. public void CustomInit(HeroAttributeData data)
  40. {
  41. Text_Name.text = data.name;
  42. Text_Value.text = data.currentValue;
  43. Text_NextValue.text = data.nextValue;
  44. }
  45. public void CustomInit1(int lanId ,HeroAttributeData data)
  46. {
  47. lanID = lanId;
  48. Text_Name.text = data.name;
  49. Text_Value.text = data.currentValue;
  50. Text_NextValue.text = data.nextValue;
  51. }
  52. }
  53. }