XianTuSaiXuanWidget.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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 = LanguageManager.Instance.Text(10163);
  34. }
  35. else
  36. {
  37. string[] fruits = LanguageManager.Instance.Text(_bigMapConfig.mapName).Split('.');
  38. Text_Name.text =fruits[1];
  39. }
  40. }
  41. else if (type == 2)
  42. {
  43. _placesConfig = ConfigComponent.Instance.Get<PlacesConfig>(id);
  44. if (_placesConfig.ID == 0)
  45. {
  46. Text_Name.text = LanguageManager.Instance.Text(10163);
  47. }
  48. else
  49. {
  50. Text_Name.text = LanguageManager.Instance.Text(_placesConfig.placeName);
  51. }
  52. }
  53. }
  54. }
  55. }