DaoLvSkillWidget.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using Core.Language;
  2. using Excel2Json;
  3. using Fort23.UTool;
  4. using Utility;
  5. namespace Fort23.Mono
  6. {
  7. [UIBinding(prefab = "DaoLvSkillWidget")]
  8. public partial class DaoLvSkillWidget : UIComponent
  9. {
  10. public daolvSkill _daolvSkill;
  11. private float value;
  12. private void Init()
  13. {
  14. }
  15. public override void AddEvent()
  16. {
  17. }
  18. public override void DelEvent()
  19. {
  20. }
  21. public override void AddButtonEvent()
  22. {
  23. }
  24. public void CustomInit(int configId, float value)
  25. {
  26. _daolvSkill = ConfigComponent.Instance.Get<daolvSkill>(configId);
  27. this.value = value;
  28. Text_Name.text = LanguageManager.Instance.Text(_daolvSkill.des, value);
  29. }
  30. public void UpdateBl(Map<int, float> bl)
  31. {
  32. float updateValue = 0;
  33. if (bl.ContainsKey(_daolvSkill.ID))
  34. {
  35. updateValue = bl[_daolvSkill.ID];
  36. }
  37. if (updateValue > value)
  38. {
  39. Text_Name.text = LanguageManager.Instance.Text(_daolvSkill.des, value) + "(+" + (updateValue - value) + ")";
  40. }
  41. else if (updateValue < value)
  42. {
  43. Text_Name.text = LanguageManager.Instance.Text(_daolvSkill.des, value) + "(" + (updateValue - value) + ")";
  44. }
  45. }
  46. }
  47. }