コード例 #1
0
ファイル: LobbyDataBase.cs プロジェクト: Tomsztyl/Snake
    IEnumerator LoginActivateCode(string username, string password, string activatecode)
    {
        WWWForm form = new WWWForm();

        form.AddField("loginUser", username);
        form.AddField("loginPass", password);
        form.AddField("loginActivateCode", activatecode);
        //Debug.Log("LoginActivateCode : " + activatecode);

        using (UnityWebRequest www = UnityWebRequest.Post("https://unityfsadsa.000webhostapp.com/gameUnity/ActivateCodeManager.php", form))
        {
            yield return(www.SendWebRequest());

            if (www.isNetworkError || www.isHttpError)
            {
                HolderConsoleDataManagerLogin.text = www.error;
            }
            else
            {
                if (www.downloadHandler.text == "Login Success")
                {
                    ControllsLogin.active = true;
                    //PlayerPrefs.SetString("ControllLogin", "true");
                    _controllsLogin     = GameObject.FindWithTag("ControllsLogin").GetComponent <ControllsLogin>();
                    ButtonMenu.active   = true;
                    TextUserButton.text = username;
                    PlayerPrefs.SetString("UsernameLogin", username);
                    PlayerPrefs.SetString("UsernamePassword", password);
                    //Debug.Log("Login User: "******"UsernameLogin"));
                }
                else if (www.downloadHandler.text == "Input activate code from email")
                {
                    InputActivateCode.active = true;
                    Debug.Log("Welcome");
                    ToggleResendCode.active = true;
                }
                HolderConsoleDataManagerLogin.text = www.downloadHandler.text;
            }
        }
    }
コード例 #2
0
 // Start is called before the first frame update
 void Start()
 {
     //_spawnManager = GameObject.Find("SpawnManager").GetComponent<SpawnManager>();
     _controllsLogin = GameObject.Find("ControllsLogin").GetComponent <ControllsLogin>();
 }