PlayAreaWaitingDrawUI.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. using System;
  2. using UnityEngine;
  3. using UnityEngine.UI;
  4. public class PlayAreaWaitingDrawUI : MonoBehaviour
  5. {
  6. public Action OnSwitchToStationaryAreaClick
  7. {
  8. get;
  9. set;
  10. }
  11. public Action OnBackClick
  12. {
  13. get;
  14. set;
  15. }
  16. public Button switchToStationaryAreaButton;
  17. public Button backButton;
  18. public Text waitingDrawTitleText;
  19. public Text waitingDrawDescribeText;
  20. public Text sationaryAreaBtnText;
  21. public void Init()
  22. {
  23. switchToStationaryAreaButton.onClick.AddListener(()=>
  24. {
  25. OnSwitchToStationaryAreaClick?.Invoke();
  26. });
  27. backButton.onClick.AddListener(()=>
  28. {
  29. OnBackClick?.Invoke();
  30. });
  31. SafetyAreaLanguageManager.Instance.onLanguageChange += ChangeLanguageText;
  32. ChangeLanguageText();
  33. }
  34. public void ChangeLanguageText()
  35. {
  36. waitingDrawTitleText.text = SafetyAreaLanguageManager.Instance.GetWord(106019);
  37. waitingDrawDescribeText.text = SafetyAreaLanguageManager.Instance.GetWord(106021);
  38. sationaryAreaBtnText.text = SafetyAreaLanguageManager.Instance.GetWord(106022);
  39. }
  40. public void Release()
  41. {
  42. switchToStationaryAreaButton.onClick.RemoveAllListeners();
  43. backButton.onClick.RemoveAllListeners();
  44. SafetyAreaLanguageManager.Instance.onLanguageChange -= ChangeLanguageText;
  45. }
  46. }