XianTuSaiXuanWidget.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. using Core.Language;
  2. using Excel2Json;
  3. using Fort23.UTool;
  4. namespace Fort23.Mono
  5. {
  6. [UIBinding(prefab = "XianTuSaiXuanWidget")]
  7. public partial class XianTuSaiXuanWidget : ItemWidgetBasic
  8. {
  9. public int type;
  10. public BigMapConfig _bigMapConfig;
  11. public PlacesConfig _placesConfig;
  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. base.AddButtonEvent();
  24. }
  25. public void CustomInit(int type, int id)
  26. {
  27. this.type = type;
  28. if (type == 1)
  29. {
  30. _bigMapConfig = ConfigComponent.Instance.Get<BigMapConfig>(id);
  31. if (_bigMapConfig.ID == 0)
  32. {
  33. Text_Name.text = "全部";
  34. }
  35. else
  36. {
  37. Text_Name.text = LanguageManager.Instance.Text(_bigMapConfig.mapName);
  38. }
  39. }
  40. else if (type == 2)
  41. {
  42. _placesConfig = ConfigComponent.Instance.Get<PlacesConfig>(id);
  43. if (_placesConfig.ID == 0)
  44. {
  45. Text_Name.text = "全部";
  46. }
  47. else
  48. {
  49. Text_Name.text = LanguageManager.Instance.Text(_placesConfig.placeName);
  50. }
  51. }
  52. }
  53. }
  54. }