ConfirmPlayAreaUI.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using System;
  2. using UnityEngine;
  3. using UnityEngine.UI;
  4. public class ConfirmPlayAreaUI : MonoBehaviour
  5. {
  6. public Action OnConfirmClick
  7. {
  8. get;
  9. set;
  10. }
  11. public Action OnBackClick
  12. {
  13. get;
  14. set;
  15. }
  16. public Button confirmClick;
  17. public Button backClick;
  18. public Text confirmSafetyAreaTitleText;
  19. public Text confirmSafetyAreaDescribeText;
  20. public Text confirmBtnText;
  21. public void Init()
  22. {
  23. confirmClick.onClick.AddListener(() =>
  24. {
  25. OnConfirmClick?.Invoke();
  26. });
  27. backClick.onClick.AddListener(()=>
  28. {
  29. OnBackClick?.Invoke();
  30. });
  31. SafetyAreaLanguageManager.Instance.onLanguageChange += ChangeLanguageText;
  32. ChangeLanguageText();
  33. }
  34. public void ChangeLanguageText()
  35. {
  36. confirmSafetyAreaTitleText.text = SafetyAreaLanguageManager.Instance.GetWord(106031);
  37. confirmSafetyAreaDescribeText.text = SafetyAreaLanguageManager.Instance.GetWord(106036);
  38. confirmBtnText.text = SafetyAreaLanguageManager.Instance.GetWord(10092);
  39. }
  40. public void Release()
  41. {
  42. confirmClick.onClick.RemoveAllListeners();
  43. backClick.onClick.RemoveAllListeners();
  44. SafetyAreaLanguageManager.Instance.onLanguageChange -= ChangeLanguageText;
  45. }
  46. }