Question by
takis_kalas · Nov 23, 2015 at 12:57 PM ·
c#databasedata
Spliting text and WWWform "if" problem
I have a big problem to make this code work. it reaches on debug "eftase ws 3" after that is dead. What might be the reason??
IEnumerator LoginAccount(){
WWWForm Form = new WWWForm();
Form.AddField("Email", Email);
Form.AddField("Password", Password);
WWW LoginAccountWWW = new WWW(LoginUrl, Form);
yield return LoginAccountWWW;
Debug.Log ("Attemting to Log In");
Debug.Log ("eftase ws 1");
if (LoginAccountWWW.error != null) {
Debug.LogError("CannotConnectToLogin"); //if there is an error, tell us
} else {
Debug.Log ("eftase ws 2");
string LongText = LoginAccountWWW.text;
Debug.Log (LongText);
Debug.Log ("eftase ws 3");
//Πιστευω εδω γινεται το λαθος.
string[] LongTextString = LongText.Split(':');
if(LongTextString[0] == "0"){
if(LongTextString[1] == "Success"){
Debug.Log ("eftase ws 4");
Application.LoadLevel("CharactrerCreation");
}
Debug.Log ("eftase ws 5");
}else{
if(LongTextString[1] == "Success"){
Application.LoadLevel("CharactrerSelection");
}
}
}
}
Comment
Not much we can do without knowing the value of LongText
.