Ive looked this up but google fu only finds int to string act,
I’v come across: CS0029: Cannot implicitly convert type string[]' to
string’
so a string cannot be a tring don’t get it…
using UnityEngine.UI;
public class LoginRegister : MonoBehaviour {
public string UserLoginURL = "http://earthaalianceonline.com/loggin";
public string UserRegiesterURL = "http://earthaalianceonline.com/register";
public string Username = "";
public string Password = "";
public bool Login = false;
public Text XPText;
public Image XPbar;
public Text GoldText;
public Text LevelText;
public Text UsernameText;
public GameObject Logedin;
//------------------------------------------------------------------------------------
void OnGUI()
{
Username = GUILayout.TextField (Username);
Password = GUILayout.TextField (Password);
if (GUILayout.Button ("Log in")) {
StartCoroutine(LoginUser());
}
}
//------------------------------------------------------------------------------------
IEnumerator LoginUser(string User, string Pass ) {
WWW Login = new WWW (UserLoginURL + "Username" + User + "Password" + Pass);
yield return Login;
if (Login.error == null) {
// display resaults: ???
UsernameText.text = Login.text.Split(","[0]);
GoldText.text = Login.text.Split(","[1]);
XPText.text = Login.text.Split(","[2]);
LevelText.text = Login.text.Split(","[3]);
}
}
}
//---------------------------------------------------------------------------------