DaoYouWidget.cs 818 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using System.Linq;
  2. using Excel2Json;
  3. using Fort23.UTool;
  4. namespace Fort23.Mono
  5. {
  6. [UIBinding(prefab = "DaoYouWidget" )]
  7. public partial class DaoYouWidget : ItemWidgetBasic
  8. {
  9. private DaoyouModelConfig _daoyouModelConfig;
  10. public AccountFileInfo.DaoYouData _daoYouData;
  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(int configId)
  25. {
  26. _daoyouModelConfig = ConfigComponent.Instance.Get<DaoyouModelConfig>(configId);
  27. _daoYouData = AccountFileInfo.Instance.playerData.daoYouDatas.FirstOrDefault(dy => dy.id == configId);
  28. if (_daoYouData == null)
  29. {
  30. transform.Gray();
  31. }
  32. else
  33. {
  34. transform.RecoverColor();
  35. }
  36. }
  37. }
  38. }