Files
ft/Client/Assets/Scripts/AntiCheat/AccountAbnormalityPopupPanel.cs
2026-06-29 21:18:33 +08:00

48 lines
1.3 KiB
C#

using asap.core;
using game;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
public class AccountAbnormalityPopupPanel : MonoBehaviour
{
//客服按钮
Button btn_confrim;
//退出游戏
Button btn_cancel;
TMP_Text text_id;
private void Awake()
{
btn_confrim = transform.Find("root/btn_confrim/btn_green").GetComponent<Button>();
btn_cancel = transform.Find("root/btn_quit/btn_green").GetComponent<Button>();
text_id = transform.Find("root/text_id").GetComponent<TMP_Text>();
}
private void Start()
{
btn_confrim.onClick.AddListener(OnClickConfirm);
btn_cancel.onClick.AddListener(OnClickCancel);
text_id.text = $"ID: {GContext.container.Resolve<IUserService>().CustomId}";
}
private void OnClickConfirm()
{
//打开客服链接
AIHelp.AIHelpSupport.Show("E001");
Debug.Log("打开客服链接");
}
private void OnClickCancel()
{
//退出游戏
Application.Quit();
Debug.Log("退出游戏");
#if UNITY_EDITOR
// 编辑器内仍调用停止播放
UnityEditor.EditorApplication.isPlaying = false;
#else
// Build包退出应用
Application.Quit();
// 注意:移动端/主机平台可能需要额外处理(如返回主菜单而非直接退出)
#endif
}
}