Upgrade + Info Button on selection
This commit is contained in:
@@ -8,11 +8,14 @@ public class LoginManager : MonoBehaviour
|
||||
{
|
||||
public TMP_InputField login_username;
|
||||
public TMP_InputField login_password;
|
||||
public Toggle rememberMe;
|
||||
public Button loginBtn;
|
||||
public TMP_InputField reg_username;
|
||||
public TMP_InputField reg_password;
|
||||
public Button regBtn;
|
||||
|
||||
public OtherUIbuttons otherUI;
|
||||
|
||||
void Start()
|
||||
{
|
||||
loginBtn.onClick.AddListener(OnLoginClicked);
|
||||
@@ -35,11 +38,17 @@ public class LoginManager : MonoBehaviour
|
||||
|
||||
public void OnLoginClicked(){
|
||||
if(login_username.text.Length < 2){
|
||||
MessageDialogInstance.messageDialog.ShowDialog("Error", "Please use a valid Username (should be more than 2 characters)");
|
||||
if(otherUI!=null){
|
||||
otherUI.ErrorAuth();
|
||||
}
|
||||
// MessageDialogInstance.messageDialog.ShowDialog("Error", "Please use a valid Username (should be more than 2 characters)");
|
||||
return;
|
||||
}
|
||||
if(login_password.text.Length < 5){
|
||||
MessageDialogInstance.messageDialog.ShowDialog("Error", "Please use a Strong password (should be more than 5 characters)");
|
||||
if(otherUI!=null){
|
||||
otherUI.ErrorAuth();
|
||||
}
|
||||
// MessageDialogInstance.messageDialog.ShowDialog("Error", "Please use a Strong password (should be more than 5 characters)");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -71,9 +80,10 @@ public class LoginManager : MonoBehaviour
|
||||
Debug.Log(www.text);
|
||||
if (www.text[0] == '0')
|
||||
{
|
||||
if(rememberMe.isOn){
|
||||
PlayerPrefs.SetString("username", login_username.text);
|
||||
PlayerPrefs.SetString("password", login_password.text);
|
||||
PlayerPrefs.Save();
|
||||
PlayerPrefs.Save();}
|
||||
DBmanager.username = login_username.text;
|
||||
DBmanager.SetGems(int.Parse(www.text.Split('\t')[2]),true);
|
||||
DBmanager.SetCoins(int.Parse(www.text.Split('\t')[1]),true);
|
||||
|
||||
Reference in New Issue
Block a user