save username password to player prefs

This commit is contained in:
Le Duc Anh
2025-10-14 10:43:04 +07:00
parent 5199df61f0
commit 258798ebde
@@ -35,6 +35,9 @@ namespace BrewMonster.UI
{
_loginButton.onClick.AddListener(OnLoginButtonClicked);
context = SynchronizationContext.Current;
_usernameInputField.text = PlayerPrefs.GetString("username", "");
_passwordInputField.text = PlayerPrefs.GetString("password", "");
}
// Update is called once per frame
@@ -67,6 +70,9 @@ namespace BrewMonster.UI
string username = _usernameInputField.text;
string password = _passwordInputField.text;
UnityGameSession.SetConnectionInfo("103.182.22.52", 29000);
PlayerPrefs.SetString("username", username);
PlayerPrefs.SetString("password", password);
PlayerPrefs.Save();
await UnityGameSession.Login(username, password, OnLoginComplete);
}