84 lines
2.7 KiB
C#
84 lines
2.7 KiB
C#
|
using System.Collections;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Net.NetworkInformation;
|
|||
|
using UnityEngine;
|
|||
|
using UnityEngine.UI;
|
|||
|
|
|||
|
|
|||
|
public struct Login
|
|||
|
{
|
|||
|
public string phonenumble;
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
public class Logo_in : mount
|
|||
|
{
|
|||
|
|
|||
|
public Slider sceneslider;
|
|||
|
public Button logo_inbtn;
|
|||
|
// Start is called before the first frame update
|
|||
|
void Start()
|
|||
|
{
|
|||
|
//sceneslider.gameObject.SetActive(false);
|
|||
|
//logo_inbtn.onClick.AddListener(ShowLogoin);
|
|||
|
login_in_screen();
|
|||
|
}
|
|||
|
|
|||
|
void ShowLogoin()
|
|||
|
{
|
|||
|
login_in_screen();
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
public void login_in_screen()//<2F><>¼<EFBFBD><C2BC><EFBFBD><EFBFBD>
|
|||
|
{
|
|||
|
|
|||
|
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 = 5 });
|
|||
|
GameObject gameObject = add_pop_up(true);//<2F><><EFBFBD>ɵ<EFBFBD><C9B5><EFBFBD>ĸ<EFBFBD><C4B8>
|
|||
|
List<GameObject> gameObjects = gameObject.GetComponent<input_box_pop_up_window>().updateUI(boxTypes, "<22><>¼");//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
//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>
|
|||
|
//{
|
|||
|
// if (boxType.is_required && string.IsNullOrWhiteSpace(boxType.content))
|
|||
|
// {
|
|||
|
// 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)//ע<><D7A2>
|
|||
|
{
|
|||
|
Login login = new Login();
|
|||
|
login.phonenumble = boxTypes[0].prompt;
|
|||
|
//register.Code = boxTypes[0].content;
|
|||
|
string jsonString = JsonUtility.ToJson(login);
|
|||
|
string response = await web.SendRequest("http://47.109.133.52/Player/Register", "POST", jsonString);
|
|||
|
Debug.Log(response);
|
|||
|
}
|
|||
|
else if (type == 1)//<2F><>¼
|
|||
|
{
|
|||
|
Login login = new Login();
|
|||
|
login.phonenumble = boxTypes[0].prompt;
|
|||
|
//register.Code = boxTypes[0].content;
|
|||
|
string jsonString = JsonUtility.ToJson(login);
|
|||
|
string response = await web.SendRequest("http://47.109.133.52/Player/Login", "POST", jsonString);
|
|||
|
Debug.Log(response);
|
|||
|
|
|||
|
}
|
|||
|
});
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
// Update is called once per frame
|
|||
|
void Update()
|
|||
|
{
|
|||
|
|
|||
|
}
|
|||
|
}
|