|
|
@@ -94,9 +94,10 @@ public class Register : MonoBehaviour {
|
|
|
}
|
|
|
|
|
|
string result = www.downloadHandler.text;
|
|
|
- if (result == "Success") {
|
|
|
+ if (int.TryParse(www.downloadHandler.text, out int userId)) {
|
|
|
errorColor.a = 0;
|
|
|
errorText.color = errorColor;
|
|
|
+ PlayerPrefs.SetInt("UserId", userId);
|
|
|
SceneManager.LoadScene("MainMenu");
|
|
|
} else {
|
|
|
errorText.text = "Failed to register, username/email already exists"; // be more helpful, get message from sever if it is username or email
|