2025-05-18 01:04:31 +08:00

87 lines
1.9 KiB
C#

// ***********************************************************************
// Assembly : Game
// Author : Kimch
// Created : 2021-10-28
// Description :
// Last Modified By :
// Last Modified On :
// ***********************************************************************
// <copyright file= "LogoffPanel" company="Kunpo"></copyright>
// <summary></summary>
// ***********************************************************************
using UnityEngine;
using UnityEngine.UI;
namespace G.UI
{
/// <summary>
///
/// </summary>
public class LogoffPanel : MonoBehaviour//KUIWidget
{
public static event System.Action<int, string> LogoffCallback;
#region Field
#pragma warning disable CS0649 // 从未对字段赋值,字段将一直保持其默认值 null
//[KUIFlag]
public Toggle _tgAgree;
//[KUIFlag]
public Button _btnBack;
//[KUIFlag]
public Button _btnNext;
//[KUIFlag]
public GameObject _btnAgreeHint;
#pragma warning restore CS0649 // 从未对字段赋值,字段将一直保持其默认值 null
#endregion
#region Method
void OnBackBtnClick()
{
Destroy(this.transform.parent.gameObject);
}
void OnNextBtnClick()
{
if (_tgAgree.isOn)
{
Destroy(this.transform.parent.gameObject);
#if SDK_OHAYOO
ByteDance.Union.LGSDKAccount.AccountService.CloseAccount(
(msg) => MessageBox.ShowMessage("注销帐号", "注销成功,点击确定退出游戏", Application.Quit),
(error, msg) => ToastBox.ShowText(msg));
#endif
}
else
{
_btnAgreeHint.gameObject.SetActive(true);
Invoke(nameof(HideAgreeHint), 1f);
}
}
void HideAgreeHint()
{
_btnAgreeHint.gameObject.SetActive(false);
}
#endregion
#region Unity
/// <summary>
///
/// </summary>
private void Awake()
{
//SetViewData();
_btnBack.onClick.AddListener(this.OnBackBtnClick);
_btnNext.onClick.AddListener(this.OnNextBtnClick);
}
#endregion
}
}