HeroAttributeWidget.cs 1.3 KB

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