SentimentEffectWidget.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. using Core.Language;
  2. using Excel2Json;
  3. using Fort23.UTool;
  4. namespace Fort23.Mono
  5. {
  6. [UIBinding(prefab = "SentimentEffectWidget")]
  7. public partial class SentimentEffectWidget : ItemWidgetBasic
  8. {
  9. public AccountFileInfo.SentimentProperty sentimentProperty;
  10. SentimentEffectConfig sentimentEffectConfig;
  11. private void Init()
  12. {
  13. }
  14. public override void AddEvent()
  15. {
  16. }
  17. public override void DelEvent()
  18. {
  19. }
  20. public override void AddButtonEvent()
  21. {
  22. base.AddButtonEvent();
  23. }
  24. public void CustomInit(AccountFileInfo.SentimentProperty sentimentProperty)
  25. {
  26. this.sentimentProperty = sentimentProperty;
  27. int level = sentimentProperty.level <= 0 ? 1 : sentimentProperty.level;
  28. int conFigId = sentimentProperty.groupId * 100 + level;
  29. sentimentEffectConfig = ConfigComponent.Instance.Get<SentimentEffectConfig>(conFigId);
  30. Text_Name.text = LanguageManager.Instance.Text(sentimentEffectConfig.name);
  31. if (sentimentProperty.level == 0)
  32. {
  33. Text_Level.text = "未激活";
  34. }
  35. else
  36. {
  37. Text_Level.text = "lv." + level;
  38. }
  39. }
  40. }
  41. }