驱蚊app
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

68 regels
1.7 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. [SerializeField]
  15. GameObject SettingButton;
  16. public override void OnOpen(params object[] args)
  17. {
  18. DeleteAccountButton.onClick.AddListener(ClickDeleteAccountButton);
  19. LogOutButton.onClick.AddListener(ClickLogOutButton);
  20. if (GameConfig.platform == RuntimePlatform.WebGLPlayer)
  21. {
  22. SettingButton.SetActive(false);
  23. }
  24. }
  25. public override void OnClose() { }
  26. public void ClickModelButton(int model)
  27. {
  28. UIManager.Instance.OpenUI<UIMainModel>(1, model);
  29. }
  30. public void ClickSettingButton()
  31. {
  32. settingViewObj.SetActive(true);
  33. appleUserIdText.text = "appleUserId:" + GameData.Instance.appleUserId;
  34. if (GameData.Instance.isYouke)
  35. {
  36. DeleteAccountButton.gameObject.SetActive(false);
  37. }
  38. else
  39. {
  40. DeleteAccountButton.gameObject.SetActive(true);
  41. }
  42. }
  43. private void ClickLogOutButton()
  44. {
  45. PlayerPrefs.DeleteKey(UILogin.AppleUserIdKey);
  46. Close();
  47. }
  48. private void ClickDeleteAccountButton()
  49. {
  50. UIManager.Instance.OpenUI<UITipsPopup>(2, "Delete Account", "Are you sure you want to delete your account?\nThis action cannot be undone.",
  51. new Action(() => {
  52. PlayerPrefs.DeleteKey(UILogin.AppleUserIdKey);
  53. Close();
  54. }),
  55. new Action(() => { }), "Delete", "Cancel");
  56. }
  57. }