PlayAreaOKUI.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. using System;
  2. using UnityEngine;
  3. using UnityEngine.UI;
  4. public class PlayAreaOKUI : MonoBehaviour
  5. {
  6. public Action OnRedrawAreaClick
  7. {
  8. get;
  9. set;
  10. }
  11. public Action OnContinueClick
  12. {
  13. get;
  14. set;
  15. }
  16. public Action OnBackClick
  17. {
  18. get;
  19. set;
  20. }
  21. public Button redrawAreaButton;
  22. public Button continueButton;
  23. public Button backButton;
  24. public Text playAreaOKText;
  25. public Text playAreaOKDescribeText;
  26. public Text continueButtonText;
  27. public Text redrawButtonText;
  28. public void Init()
  29. {
  30. redrawAreaButton.onClick.AddListener(() =>
  31. {
  32. OnRedrawAreaClick?.Invoke();
  33. });
  34. continueButton.onClick.AddListener(() =>
  35. {
  36. OnContinueClick?.Invoke();
  37. });
  38. backButton.onClick.AddListener(() =>
  39. {
  40. OnBackClick?.Invoke();
  41. });
  42. SafetyAreaLanguageManager.Instance.onLanguageChange += ChangeLanguageText;
  43. ChangeLanguageText();
  44. }
  45. public void ChangeLanguageText()
  46. {
  47. playAreaOKText.text = SafetyAreaLanguageManager.Instance.GetWord(106033);
  48. playAreaOKDescribeText.text = SafetyAreaLanguageManager.Instance.GetWord(106034);
  49. continueButtonText.text = SafetyAreaLanguageManager.Instance.GetWord(10092);
  50. redrawButtonText.text = SafetyAreaLanguageManager.Instance.GetWord(106027);
  51. }
  52. public void Release()
  53. {
  54. redrawAreaButton.onClick.RemoveAllListeners();
  55. continueButton.onClick.RemoveAllListeners();
  56. backButton.onClick.RemoveAllListeners();
  57. SafetyAreaLanguageManager.Instance.onLanguageChange -= ChangeLanguageText;
  58. }
  59. }