2024-10-29 16:00:02 +08:00
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
2024-10-30 16:40:56 +08:00
|
|
|
|
using System.Threading.Tasks;
|
2024-10-30 18:45:08 +08:00
|
|
|
|
using Unity.VisualScripting;
|
2024-10-29 16:00:02 +08:00
|
|
|
|
using UnityEngine;
|
2024-10-30 19:42:59 +08:00
|
|
|
|
using static UnityEditor.PlayerSettings;
|
|
|
|
|
|
2024-10-30 01:06:46 +08:00
|
|
|
|
[System.Serializable]
|
|
|
|
|
public struct Register
|
|
|
|
|
{
|
|
|
|
|
public string Phone;
|
|
|
|
|
}
|
2024-10-30 19:42:59 +08:00
|
|
|
|
|
|
|
|
|
public struct AddGold
|
|
|
|
|
{
|
|
|
|
|
public int Gold;
|
|
|
|
|
}
|
|
|
|
|
|
2024-10-30 22:03:04 +08:00
|
|
|
|
public struct Login
|
|
|
|
|
{
|
|
|
|
|
public string Phone;
|
|
|
|
|
}
|
|
|
|
|
|
2024-10-31 16:50:35 +08:00
|
|
|
|
public struct GetListByPhone
|
|
|
|
|
{
|
|
|
|
|
public string Phone;
|
|
|
|
|
}
|
2024-10-31 01:28:14 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-10-29 16:00:02 +08:00
|
|
|
|
public class mount : MonoBehaviour
|
|
|
|
|
{
|
2024-10-30 04:21:58 +08:00
|
|
|
|
public static mount mountitem;
|
2024-10-29 16:00:02 +08:00
|
|
|
|
// Start is called before the first frame update
|
2024-10-31 13:27:31 +08:00
|
|
|
|
public virtual void Awake()
|
2024-10-29 16:00:02 +08:00
|
|
|
|
{
|
2024-10-30 04:21:58 +08:00
|
|
|
|
mountitem = this;
|
2024-10-29 16:00:02 +08:00
|
|
|
|
DontDestroyOnLoad(this);
|
|
|
|
|
|
2024-10-29 20:47:58 +08:00
|
|
|
|
|
2024-10-30 04:21:58 +08:00
|
|
|
|
//mountitem.login_screen();
|
|
|
|
|
|
2024-10-29 20:47:58 +08:00
|
|
|
|
}
|
2024-10-31 20:16:46 +08:00
|
|
|
|
[System.Serializable]
|
|
|
|
|
public class MyJsonData
|
|
|
|
|
{
|
|
|
|
|
public object list;
|
|
|
|
|
}
|
2024-10-30 16:40:56 +08:00
|
|
|
|
private async void Start()
|
|
|
|
|
{
|
2024-10-31 20:16:46 +08:00
|
|
|
|
string jsonString = "{\"list\":1.2333333}";
|
|
|
|
|
MyJsonData itemList = JsonUtility.FromJson<MyJsonData>(jsonString);
|
|
|
|
|
Debug.Log(itemList.list);
|
|
|
|
|
Debug.Log((float)itemList.list);
|
|
|
|
|
Debug.Log("======");
|
|
|
|
|
|
2024-10-30 19:42:59 +08:00
|
|
|
|
|
|
|
|
|
//AddGold AddGold = new AddGold();
|
|
|
|
|
//AddGold.Gold = 100;
|
|
|
|
|
//string jsonString1 = JsonUtility.ToJson(AddGold);
|
|
|
|
|
//string response_1 = await web.SendRequest(web.URL + "/Player/Login", "POST", jsonString1);
|
|
|
|
|
//de
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-10-30 22:03:04 +08:00
|
|
|
|
//Login register = new Login();
|
|
|
|
|
//register.phonenumble = "13667637952";
|
|
|
|
|
//string jsonString = JsonUtility.ToJson(register);
|
|
|
|
|
//string response_1 = await web.SendRequest("http://47.109.133.52/Player/Login", "POST", jsonString);
|
2024-10-30 19:42:59 +08:00
|
|
|
|
|
2024-10-30 22:03:04 +08:00
|
|
|
|
//Register register = new Register();
|
|
|
|
|
//register.Phone = "13667637952";
|
|
|
|
|
//string jsonString = JsonUtility.ToJson(register);
|
2024-10-30 19:42:59 +08:00
|
|
|
|
|
2024-10-30 22:03:04 +08:00
|
|
|
|
//string response_1 = await web.SendRequest("http://47.109.133.52/Player/Login", "POST", jsonString);
|
|
|
|
|
//Debug.Log(response_1);
|
2024-10-30 19:42:59 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//string response_2 = await web.SendRequest("http://47.109.133.52/MinerElf/GetList", "POST");
|
|
|
|
|
//Debug.Log(response_2);
|
2024-10-30 16:40:56 +08:00
|
|
|
|
}
|
2024-10-30 04:21:58 +08:00
|
|
|
|
public GameObject add_pop_up(bool is_force = false)//<2F><><EFBFBD>ӵ<EFBFBD><D3B5><EFBFBD>
|
2024-10-29 20:47:58 +08:00
|
|
|
|
{
|
|
|
|
|
GameObject prefab = Resources.Load<GameObject>("preform/gui/pop_up_ui");
|
|
|
|
|
GameObject ranking_list_item = Instantiate(prefab, this.transform);
|
2024-10-30 04:21:58 +08:00
|
|
|
|
ranking_list_item.GetComponent<input_box_pop_up_window>().is_force = is_force;
|
2024-10-29 20:47:58 +08:00
|
|
|
|
return ranking_list_item;
|
|
|
|
|
}
|
|
|
|
|
//0 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
//1 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ť
|
|
|
|
|
//2 ȡ<><C8A1><EFBFBD><EFBFBD>ť ȷ<><C8B7><EFBFBD><EFBFBD>ť
|
2024-10-30 04:21:58 +08:00
|
|
|
|
//3 <20><><EFBFBD><EFBFBD><EFBFBD>˲<EFBFBD>item
|
|
|
|
|
//4 <20><><EFBFBD><EFBFBD><EFBFBD>˲<EFBFBD><CBB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
2024-10-29 20:47:58 +08:00
|
|
|
|
public void login_screen()//ע<><D7A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
|
2024-10-30 03:42:06 +08:00
|
|
|
|
List<BoxType> boxTypes = new List<BoxType>();
|
|
|
|
|
boxTypes.Add(new BoxType { Name = "account_number", textName = " <20>ֻ<EFBFBD><D6BB><EFBFBD>", prompt= "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֻ<EFBFBD><D6BB><EFBFBD>", Type = 1, is_required = true });
|
|
|
|
|
boxTypes.Add(new BoxType { Name = "verification_code", textName = " <20><>֤<EFBFBD><D6A4> ", prompt = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD><D6A4>", Type = 0, is_required = true });
|
|
|
|
|
boxTypes.Add(new BoxType { Name = "submit", textName = " ȡ<><C8A1>ȷ<EFBFBD><C8B7> ",Type = 2});
|
2024-10-30 04:21:58 +08:00
|
|
|
|
GameObject gameObject = add_pop_up(true);//<2F><><EFBFBD>ɵ<EFBFBD><C9B5><EFBFBD>ĸ<EFBFBD><C4B8>
|
2024-10-30 01:06:46 +08:00
|
|
|
|
List<GameObject> gameObjects = gameObject.GetComponent<input_box_pop_up_window>().updateUI(boxTypes, "ע<><D7A2>");//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
2024-10-29 20:47:58 +08:00
|
|
|
|
gameObjects[0].GetComponent<input_box_pop_up_window_item>().register_click((BoxType boxType,int type) =>//<2F>ֻ<EFBFBD><D6BB>Ż<EFBFBD>ȡ<EFBFBD><C8A1>֤<EFBFBD><D6A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
2024-10-30 01:06:46 +08:00
|
|
|
|
if (boxType.is_required && string.IsNullOrWhiteSpace(boxType.content)) {
|
2024-10-29 20:47:58 +08:00
|
|
|
|
Promptmgr.Instance.PromptBubble("<22>벻Ҫ" + boxType.textName + "Ϊ<><CEAA>");
|
|
|
|
|
return; }
|
|
|
|
|
Debug.Log("<22><>ȡ<EFBFBD><C8A1>֤<EFBFBD><D6A4>");
|
|
|
|
|
});
|
|
|
|
|
gameObjects[2].GetComponent<input_box_pop_up_window_item>().register_click(async (BoxType boxType, int type) =>//<2F><>¼ȷ<C2BC><C8B7><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1>
|
|
|
|
|
{
|
|
|
|
|
if (type == 0){
|
2024-10-30 18:45:08 +08:00
|
|
|
|
gameObject.GetComponent<input_box_pop_up_window>().destroy();
|
2024-10-29 20:47:58 +08:00
|
|
|
|
}
|
|
|
|
|
else if (type == 1){
|
2024-10-30 01:06:46 +08:00
|
|
|
|
Register register = new Register();
|
|
|
|
|
register.Phone = boxTypes[0].content;
|
2024-10-30 16:40:56 +08:00
|
|
|
|
//register.Code = boxTypes[0].content;
|
2024-10-30 01:06:46 +08:00
|
|
|
|
string jsonString = JsonUtility.ToJson(register);
|
2024-10-30 03:42:06 +08:00
|
|
|
|
string response = await web.SendRequest("http://47.109.133.52/Player/Register", "POST", jsonString);
|
2024-10-29 20:47:58 +08:00
|
|
|
|
Debug.Log(response);
|
|
|
|
|
}
|
|
|
|
|
});
|
2024-10-30 03:42:06 +08:00
|
|
|
|
|
|
|
|
|
}
|
2024-10-30 19:42:59 +08:00
|
|
|
|
|
|
|
|
|
|
2024-10-30 04:46:20 +08:00
|
|
|
|
|
2024-10-29 16:00:02 +08:00
|
|
|
|
}
|