Cute_demon_attacks/meng_yao/Assets/script/TanChuang/Customer_serviceTanchuang.cs

90 lines
3.2 KiB
C#
Raw Normal View History

2024-11-15 15:13:21 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
2024-12-23 17:53:25 +08:00
using UnityEngine.SceneManagement;
using Newtonsoft.Json.Bson;
2024-11-15 15:13:21 +08:00
public class Customer_serviceTanchuang : mount
{
public Button Kfbtn;
public Transform canvas;
2024-12-17 22:44:43 +08:00
public Button LogoutBtn;
public Button TransferBtn;
public GameObject transferPassword;
2024-11-15 15:13:21 +08:00
// Start is called before the first frame update
void Start()
{
Kfbtn.onClick.AddListener(Display_pop_up_window);
2024-12-17 22:44:43 +08:00
LogoutBtn.onClick.AddListener(LogoutClick);
TransferBtn.onClick.AddListener(transferClick);
2024-11-15 15:13:21 +08:00
}
2024-12-17 22:44:43 +08:00
private void LogoutClick()
{
List<BoxType> boxTypes = new List<BoxType>();
2024-12-25 12:02:14 +08:00
boxTypes.Add(new BoxType { Name = "", prompt = <><C8B7>", Type = 13, content = <><C8B7>ע<EFBFBD><D7A2>" });
2024-12-17 22:44:43 +08:00
boxTypes.Add(new BoxType { Name = "submit", textName = " ȡ<><C8A1>ȷ<EFBFBD><C8B7> ", prompt = <><C8A1>", Type = 2 });
GameObject gameObject = add_pop_up();
2024-12-23 17:53:25 +08:00
List<GameObject> gameObjects = gameObject.GetComponent<input_box_pop_up_window>().updateUI(boxTypes, <><D7A2><EFBFBD>˺<EFBFBD>");//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>
2024-12-17 22:44:43 +08:00
gameObjects[1].GetComponent<input_box_pop_up_window_item>().register_click(async (BoxType boxType, int type) =>//<2F><>¼ȷ<C2BC><C8B7><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1>
{
if (type == 0)//ȡ<><C8A1>
{
gameObject.GetComponent<input_box_pop_up_window>().destroy();
}
else if (type == 1)//<2F>
{
bool issucceffull = await Scene_main_jiekou.instance.Cancellations();
if (issucceffull)
{
PlayerPrefs.DeleteKey("UserToken");
2024-12-23 17:53:25 +08:00
SceneManager.LoadScene(0);
2024-12-17 22:44:43 +08:00
}
else
{
Debug.Log(<><D7A2>ʧ<EFBFBD><CAA7>");
}
}
});
}
private void transferClick()
{
Instantiate(transferPassword, canvas);
}
2024-12-17 22:44:43 +08:00
2024-11-15 15:13:21 +08:00
2024-12-17 22:44:43 +08:00
private void Display_pop_up_window()//<2F><>ϵ<EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD><EFBFBD>
2024-11-15 15:13:21 +08:00
{
List<BoxType> boxTypes = new List<BoxType>();
boxTypes.Add(new BoxType { Name = "", prompt = "", Type = 13, content = "<22>ͷ<EFBFBD><CDB7><EFBFBD>ϵ<EFBFBD><CFB5>ʽ<EFBFBD><CABD>qq<71><71>5649846541654" });
2024-12-25 12:02:14 +08:00
boxTypes.Add(new BoxType { Name = "", prompt = <><C8B7>", Type = 11 });
2024-11-15 15:13:21 +08:00
GameObject gameObject = add_pop_up();
gameObject.transform.position = new Vector3(Screen.width / 2, Screen.height / 2, 0);
gameObject.transform.SetParent(canvas);
gameObject.GetComponent<input_box_pop_up_window>().minHeight = 300;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͸߶<CDB8>
gameObject.GetComponent<input_box_pop_up_window>().setScrollMode(0);//<2F><><EFBFBD>ù<EFBFBD><C3B9><EFBFBD>ģʽΪ<CABD><CEAA><EFBFBD><EFBFBD>
//gameObject.GetComponent<input_box_pop_up_window>().setScrollMode(0);//<2F><><EFBFBD>ù<EFBFBD><C3B9><EFBFBD>ģʽΪ<CABD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>
List<GameObject> gameObjects = gameObject.GetComponent<input_box_pop_up_window>().updateUI(boxTypes, "<22><>ϵ<EFBFBD>ͷ<EFBFBD>");//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>
2024-12-26 04:16:29 +08:00
Clipboard.CopyToClipboard("5649846541654");
2024-11-15 15:13:21 +08:00
gameObjects[1].GetComponent<input_box_pop_up_window_item>().register_click(async (BoxType boxType, int type) =>//<2F><>¼ȷ<C2BC><C8B7><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1>
{
if (type == 1)
{
2024-12-26 04:16:29 +08:00
2024-11-15 15:13:21 +08:00
gameObject.GetComponent<input_box_pop_up_window>().destroy();
}
});
}
// Update is called once per frame
void Update()
{
}
}