驱蚊app
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 
 

62 rindas
1.5 KiB

  1. using System;
  2. using UnityEngine;
  3. using UnityEngine.UI;
  4. public class UIMainMenu : UIBase
  5. {
  6. [SerializeField]
  7. GameObject settingViewObj;
  8. [SerializeField]
  9. Text appleUserIdText;
  10. [SerializeField]
  11. Button DeleteAccountButton;
  12. [SerializeField]
  13. Button LogOutButton;
  14. public override void OnOpen(params object[] args)
  15. {
  16. DeleteAccountButton.onClick.AddListener(ClickDeleteAccountButton);
  17. LogOutButton.onClick.AddListener(ClickLogOutButton);
  18. }
  19. public override void OnClose() { }
  20. public void ClickModelButton(int model)
  21. {
  22. UIManager.Instance.OpenUI<UIMainModel>(1, model);
  23. }
  24. public void ClickSettingButton()
  25. {
  26. settingViewObj.SetActive(true);
  27. appleUserIdText.text = "appleUserId:" + GameData.Instance.appleUserId;
  28. if (GameData.Instance.isYouke)
  29. {
  30. DeleteAccountButton.gameObject.SetActive(false);
  31. }
  32. else
  33. {
  34. DeleteAccountButton.gameObject.SetActive(true);
  35. }
  36. }
  37. private void ClickLogOutButton()
  38. {
  39. PlayerPrefs.DeleteKey(UILogin.AppleUserIdKey);
  40. Close();
  41. }
  42. private void ClickDeleteAccountButton()
  43. {
  44. UIManager.Instance.OpenUI<UITipsPopup>(2, "Delete Account", "Are you sure you want to delete your account?\nThis action cannot be undone.",
  45. new Action(() => {
  46. PlayerPrefs.DeleteKey(UILogin.AppleUserIdKey);
  47. Close();
  48. }),
  49. new Action(() => { }), "Delete", "Cancel");
  50. }
  51. }