|
- using System;
- using UnityEngine;
- using UnityEngine.UI;
-
- public class UIMainMenu : UIBase
- {
- [SerializeField]
- GameObject settingViewObj;
- [SerializeField]
- Text appleUserIdText;
-
- [SerializeField]
- Button DeleteAccountButton;
- [SerializeField]
- Button LogOutButton;
-
-
- public override void OnOpen(params object[] args)
- {
- DeleteAccountButton.onClick.AddListener(ClickDeleteAccountButton);
- LogOutButton.onClick.AddListener(ClickLogOutButton);
- }
-
-
- public override void OnClose() { }
-
- public void ClickModelButton(int model)
- {
- UIManager.Instance.OpenUI<UIMainModel>(1, model);
- }
-
- public void ClickSettingButton()
- {
- settingViewObj.SetActive(true);
- appleUserIdText.text = "appleUserId:" + GameData.Instance.appleUserId;
- if (GameData.Instance.isYouke)
- {
- DeleteAccountButton.gameObject.SetActive(false);
- }
- else
- {
- DeleteAccountButton.gameObject.SetActive(true);
- }
- }
-
- private void ClickLogOutButton()
- {
- PlayerPrefs.DeleteKey(UILogin.AppleUserIdKey);
- Close();
- }
-
- private void ClickDeleteAccountButton()
- {
- UIManager.Instance.OpenUI<UITipsPopup>(2, "Delete Account", "Are you sure you want to delete your account?\nThis action cannot be undone.",
- new Action(() => {
- PlayerPrefs.DeleteKey(UILogin.AppleUserIdKey);
- Close();
- }),
- new Action(() => { }), "Delete", "Cancel");
- }
- }
|