NoMapUI.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. public class NoMapUI : MonoBehaviour
  6. {
  7. public Button safetyAreaButton;
  8. public Text outOfSafetyAreaText;
  9. public Text createSafetyAreaText;
  10. // Start is called before the first frame update
  11. private void Start()
  12. {
  13. safetyAreaButton.onClick.AddListener(OnSafetyAreaButtonClick);
  14. }
  15. private void OnDestroy()
  16. {
  17. safetyAreaButton.onClick.RemoveListener(OnSafetyAreaButtonClick);
  18. }
  19. private void OnEnable()
  20. {
  21. SafetyAreaLanguageManager.Instance.onLanguageChange += ChangeLanguageText;
  22. ChangeLanguageText();
  23. }
  24. private void OnDisable()
  25. {
  26. SafetyAreaLanguageManager.Instance.onLanguageChange -= ChangeLanguageText;
  27. }
  28. public void ChangeLanguageText()
  29. {
  30. outOfSafetyAreaText.text = SafetyAreaLanguageManager.Instance.GetWord(106037);
  31. createSafetyAreaText.text = SafetyAreaLanguageManager.Instance.GetWord(106038);
  32. }
  33. private void OnSafetyAreaButtonClick()
  34. {
  35. SafetyAreaManager.Instance.StartSetSafetyArea();
  36. }
  37. }