Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // From http://blogs.floriancavallo.fr/post/2012/07/17/Unity-Creer-une-interface-de-Login.aspx
- private void makeLogin(string username,string password)
- {
- WWWForm form = new WWWForm();
- form.AddField("login", username);
- form.AddField("password", password);
- //WWW www = new WWW("http://monserveur.fr/connexion.php", form);
- WWW www = new WWW("http://monserveur.fr/connexion.php?login="+username+"&password="+password);
- //Ici on lance le login en Asynchrone
- StartCoroutine(WaitForRequest(www));
- }
- private IEnumerator WaitForRequest(WWW www)
- {
- yield return www;
- if (www.error == null)
- {
- if(www.text == "connexionOk"){
- Application.LoadLevel(1);
- }
- }
- else
- {
- Debug.Log("WWW Error: " + www.error);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement