Beispiel #1
0
    public IEnumerator CallLogin(string User, string Pass)
    {
        WWW www = new WWW("http://mmahgoub-001-site1.htempurl.com/WebService.asmx/LogInXml?Username="******"&Password="******"Customer");

            string userid = node [0].ChildNodes.Item(0).InnerText.Trim();
            print("id is " + userid);
            if (int.Parse(userid) != 0)
            {
                PlayerPrefs.SetString("UserID", userid);
                PlayerPrefs.SetString("UserName", User);
                PlayerPrefs.SetString("UserPassword", Pass);
                SceneManager.LoadScene("Level01");
            }
            else
            {
                LoginUserName.GetComponent <InputField>().text = "";
                LoginPassword.GetComponent <InputField>().text = "";
                StartCoroutine(InvalidInput(InvalidLogin));
            }
        } catch (XmlException e) {
            print(e.Message);
        }
    }
Beispiel #2
0
    public void ValidationLogin()
    {
        LoginNameText = LoginUserName.GetComponent <InputField> ().text;
        LoginPassText = LoginPassword.GetComponent <InputField> ().text;

        if (LoginNameText != "" && LoginPassText != "")
        {
            StartCoroutine(CallLogin(LoginNameText, LoginPassText));
        }
        else
        {
            LoginUserName.GetComponent <InputField>().text = "";
            LoginPassword.GetComponent <InputField>().text = "";
            StartCoroutine(InvalidInput(InvalidLogin));
        }
    }