2024-10-30 19:42:59 +08:00
using System.Collections ;
using System.Collections.Generic ;
using System.Net.NetworkInformation ;
using UnityEngine ;
2024-10-30 22:03:04 +08:00
using UnityEngine.SceneManagement ;
2024-10-30 19:42:59 +08:00
using UnityEngine.UI ;
2024-10-30 22:03:04 +08:00
2024-10-30 19:42:59 +08:00
public class Logo_in : mount
{
public Slider sceneslider ;
public Button logo_inbtn ;
2024-10-30 22:03:04 +08:00
public float loadSpeed = 0.5f ; // <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ٶ<EFBFBD>
2024-11-12 17:35:15 +08:00
public float loadDuration = 5f ; // <20> ܼ<EFBFBD> <DCBC> <EFBFBD> ʱ<EFBFBD> 䣬<EFBFBD> <E4A3AC> <EFBFBD> ڼ<EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2024-11-11 12:04:41 +08:00
public float smoothingSpeed = 0.1f ;
2024-10-31 13:27:31 +08:00
public override void Awake ( )
{
}
2024-10-30 19:42:59 +08:00
// Start is called before the first frame update
void Start ( )
{
//sceneslider.gameObject.SetActive(false);
//logo_inbtn.onClick.AddListener(ShowLogoin);
2024-10-30 22:03:04 +08:00
if ( sceneslider ! = null )
{
sceneslider . value = 0f ; // <20> <> ʼ ֵ<CABC> <D6B5> Ϊ0
}
2024-10-30 19:42:59 +08:00
2024-11-14 20:14:49 +08:00
PlayerPrefs . SetInt ( "SceneStatus" , - 1 ) ;
2024-11-11 12:04:41 +08:00
Privacy_Policy_screen ( ) ;
}
public void Privacy_Policy_screen ( )
{
List < BoxType > boxTypes = new List < BoxType > ( ) ;
boxTypes . Add ( new BoxType { Name = "" , prompt = "" , Type = 9 , widthnum = 700 , WidthHeight = 650 , content = "<22> <> <EFBFBD> <EFBFBD> ʹ <EFBFBD> <CAB9> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> (<28> <> <EFBFBD> <EFBFBD> )<29> <> <EFBFBD> <EFBFBD> ǰ<EFBFBD> <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> <C8A8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ƶ<EFBFBD> <C6B5> <EFBFBD> <EFBFBD> Լ<EEA1A2> <D4BC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʽ <EFBFBD> <CABD> ˾<EFBFBD> <CBBE> <EFBFBD> <EFBFBD> Ͻ<EFBFBD> <CFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EEA1A3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ϸ<EFBFBD> Ķ<EFBFBD> <C4B6> <EFBFBD> ͬ<EFBFBD> <CDAC> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϸ<EFBFBD> û<EFBFBD> Э<EFBFBD> 顢<EFBFBD> <E9A1A2> ˽<EFBFBD> <CBBD> <EFBFBD> <EFBFBD> ָ<EFBFBD> <D6B8> <EFBFBD> Ͷ<EFBFBD> ͯ<EFBFBD> <CDAF> ˽<EFBFBD> <CBBD> <EFBFBD> <EFBFBD> ָ<EFBFBD> <D6B8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͬ<EFBFBD> ⡱<EFBFBD> <E2A1B1> ʼ ʹ <CABC> <CAB9> <EFBFBD> <EFBFBD> <EFBFBD> ǵķ<C7B5> <C4B7> <EFBFBD> <EFBFBD> <EFBFBD> " } ) ;
boxTypes . Add ( new BoxType { Name = "submit" , textName = " ȡ<> <C8A1> ȷ<EFBFBD> <C8B7> " , Type = 12 } ) ;
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> û<EFBFBD> Э<EFBFBD> <D0AD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˽<EFBFBD> <CBBD> <EFBFBD> <EFBFBD> ָ<EFBFBD> <D6B8> " ) ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ص<EFBFBD> <D8B5> <EFBFBD> <EFBFBD> <EFBFBD>
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 )
{
2024-11-12 17:35:15 +08:00
2024-11-11 12:04:41 +08:00
}
else if ( type = = 1 )
2024-11-12 17:35:15 +08:00
{
Real_name_screen ( ) ;
2024-11-11 12:04:41 +08:00
gameObject . GetComponent < input_box_pop_up_window > ( ) . destroy ( ) ;
}
} ) ;
}
public void Real_name_screen ( )
{
List < BoxType > boxTypes = new List < BoxType > ( ) ;
2024-11-12 17:35:15 +08:00
boxTypes . Add ( new BoxType { Name = "" , prompt = "" , Type = 13 , content = "<22> <> <EFBFBD> <EFBFBD> <EFBFBD> йز<D0B9> <D8B2> ŵĹ涨<C4B9> <E6B6A8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϸ<EFBFBD> û<EFBFBD> <C3BB> <EFBFBD> Ҫʹ <D2AA> <CAB9> <EFBFBD> <EFBFBD> Ч<EFBFBD> <D0A7> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϣ<EFBFBD> <CFA2> <EFBFBD> <EFBFBD> ʵ<EFBFBD> <CAB5> ע<EFBFBD> ᣬΪ<E1A3AC> <CEAA> <EFBFBD> ܽ<EFBFBD> <DCBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϸ<EFBFBD> <CFB7> <EFBFBD> <EFBFBD> <EEA3AC> <EFBFBD> <EFBFBD> <EFBFBD> Ҿ<EFBFBD> <D2BE> <EFBFBD> ʵ<EFBFBD> <CAB5> ע<EFBFBD> ᡣ<EFBFBD> <E1A1A3> <EFBFBD> dz<EFBFBD> ŵ<EFBFBD> <C5B5> <EFBFBD> ϸ<CFB8> <F1B1A3BB> <EFBFBD> <EFBFBD> ĸ<EFBFBD> <C4B8> <EFBFBD> <EFBFBD> <EFBFBD> Ϣ<EFBFBD> <CFA2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> й¶<D0B9> <C2B6> " } ) ;
boxTypes . Add ( new BoxType { Name = "verification_code" , textName = " <20> <> <EFBFBD> <EFBFBD> " , prompt = "<22> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʵ<EFBFBD> <CAB5> <EFBFBD> <EFBFBD> " , Type = 0 , is_required = true } ) ;
boxTypes . Add ( new BoxType { Name = "verification_code" , textName = " <20> <> <EFBFBD> <EFBFBD> ֤" , prompt = "<22> <> <EFBFBD> <EFBFBD> <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-11-11 12:04:41 +08:00
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 , "ʵ<> <CAB5> <EFBFBD> <EFBFBD> ֤" ) ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ص<EFBFBD> <D8B5> <EFBFBD> <EFBFBD> <EFBFBD>
2024-11-12 17:35:15 +08:00
gameObjects [ 3 ] . 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>
{
Application . Quit ( ) ;
}
else if ( type = = 1 ) //<2F> ύ
{
login_in_screen ( ) ;
gameObject . GetComponent < input_box_pop_up_window > ( ) . destroy ( ) ;
}
} ) ;
2024-11-11 12:04:41 +08:00
2024-10-30 19:42:59 +08:00
}
2024-11-12 17:35:15 +08:00
public void login_in_screen ( ) //<2F> <> ¼<EFBFBD> <C2BC> <EFBFBD> <EFBFBD>
2024-10-30 19:42:59 +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 = 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>
{
2024-11-11 12:04:41 +08:00
//Login login = new Login();
//login.Phone = boxTypes[0].content;
////register.Code = boxTypes[0].content;
//string jsonString = JsonUtility.ToJson(login);
//string response = await web.SendRequest(web.URL+"/Player/Register", "POST", jsonString);
//Debug.Log(response);
2024-10-30 19:42:59 +08:00
}
else if ( type = = 1 ) //<2F> <> ¼
{
2024-11-11 12:04:41 +08:00
//Login login = new Login();
//login.Phone = boxTypes[0].content;
//Debug.Log(boxTypes[0].content);
////register.Code = boxTypes[0].content;
//string jsonString = JsonUtility.ToJson(login);
//string response = await web.SendRequest(web.URL+"/Player/Login", "POST", jsonString);
//Debug.Log(response);
2024-10-30 19:42:59 +08:00
2024-11-03 15:09:40 +08:00
2024-11-11 12:04:41 +08:00
//Rootobject root = JsonUtility.FromJson<Rootobject>(response);
2024-10-30 22:03:04 +08:00
2024-10-31 01:19:19 +08:00
2024-11-11 12:04:41 +08:00
//if (root.ErrorMessage=="" && boxTypes[0].content!= "")
//{
// gameObject.SetActive(false);
// Promptmgr.Instance.PromptBubble("<22> <> ¼<EFBFBD> ɹ<EFBFBD> ");
// isLoading = true;
//}
//else
//{
// Promptmgr.Instance.PromptBubble("<22> <> ¼ʧ<C2BC> <CAA7> ,<2C> <> <EFBFBD> <EFBFBD> ע<EFBFBD> <D7A2> ");
//}
2024-10-30 22:03:04 +08:00
2024-11-05 14:29:51 +08:00
gameObject . SetActive ( false ) ;
Promptmgr . Instance . PromptBubble ( "<22> <> ¼<EFBFBD> ɹ<EFBFBD> " ) ;
2024-11-11 12:04:41 +08:00
StartCoroutine ( LoadSceneWithProgress ( ) ) ;
}
2024-11-05 14:29:51 +08:00
} ) ;
2024-10-30 19:42:59 +08:00
}
2024-11-11 12:04:41 +08:00
IEnumerator LoadSceneWithProgress ( )
2024-10-30 19:42:59 +08:00
{
2024-11-12 17:35:15 +08:00
// <20> <> ʼ <EFBFBD> 첽<EFBFBD> <ECB2BD> <EFBFBD> س<EFBFBD> <D8B3> <EFBFBD>
2024-11-14 16:05:27 +08:00
AsyncOperation asyncLoad = SceneManager . LoadSceneAsync ( JumpScene . scene_Main ) ;
2024-11-11 12:04:41 +08:00
asyncLoad . allowSceneActivation = false ;
2024-11-16 01:07:21 +08:00
float timer = 0f ;
2024-10-30 22:03:04 +08:00
2024-11-16 01:07:21 +08:00
while ( ! asyncLoad . isDone )
2024-10-30 22:03:04 +08:00
{
2024-11-16 01:07:21 +08:00
// <20> <> <EFBFBD> ¼<EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
timer + = Time . deltaTime ;
float progress = Mathf . Clamp01 ( timer / loadDuration ) ;
2024-11-11 12:04:41 +08:00
2024-11-16 01:07:21 +08:00
// <20> <> <EFBFBD> ý<EFBFBD> <C3BD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֵ
sceneslider . value = progress ;
2024-11-11 12:04:41 +08:00
2024-11-16 01:07:21 +08:00
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> Ƿ<EFBFBD> <C7B7> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ҽ <EFBFBD> <D2BD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 100%
if ( asyncLoad . progress > = 0.9f & & progress > = 1f )
{
// <20> ӳٶ<D3B3> <D9B6> <EFBFBD> ʱ<EFBFBD> 䣬ȷ<E4A3AC> <C8B7> <EFBFBD> <EFBFBD> <EFBFBD> ҿ<EFBFBD> <D2BF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
yield return new WaitForSeconds ( 0.5f ) ;
asyncLoad . allowSceneActivation = true ; // <20> л<EFBFBD> <D0BB> <EFBFBD> <EFBFBD> <EFBFBD>
}
2024-11-11 12:04:41 +08:00
2024-11-16 01:07:21 +08:00
yield return null ;
}
2024-11-11 12:04:41 +08:00
}
2024-10-30 22:03:04 +08:00
2024-11-12 17:35:15 +08:00
2024-10-30 19:42:59 +08:00
}
2024-10-30 22:03:04 +08:00
public class Rootobject
{
public int ErrorCode ;
public string ErrorMessage ;
}
public class JsonParser
{
public static Rootobject ParseJson ( string json )
{
return JsonUtility . FromJson < Rootobject > ( json ) ;
}
}