Add forgot username/password buttons (sends email right now only, everything else needs to be finished on the server rn)
This commit is contained in:
@@ -12,6 +12,7 @@ public class AccountHandler : MonoBehaviour
|
||||
[SerializeField] private AccountChangeUsername accountChangeUsername;
|
||||
[SerializeField] private AccountChangePassword accountChangePassword;
|
||||
[SerializeField] private AccountRefreshLogin accountRefreshLogin;
|
||||
[SerializeField] internal AccountForgotDetails accountForgotDetails;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
@@ -42,6 +43,7 @@ public class AccountHandler : MonoBehaviour
|
||||
accountChangeUsername.gameObject.SetActive(false);
|
||||
accountChangePassword.gameObject.SetActive(false);
|
||||
accountRefreshLogin.gameObject.SetActive(false);
|
||||
accountForgotDetails.gameObject.SetActive(false);
|
||||
break;
|
||||
case 1:
|
||||
accountLoggedIn.gameObject.SetActive(false);
|
||||
@@ -51,6 +53,7 @@ public class AccountHandler : MonoBehaviour
|
||||
accountChangeUsername.gameObject.SetActive(false);
|
||||
accountChangePassword.gameObject.SetActive(false);
|
||||
accountRefreshLogin.gameObject.SetActive(false);
|
||||
accountForgotDetails.gameObject.SetActive(false);
|
||||
break;
|
||||
case 2:
|
||||
accountLoggedIn.gameObject.SetActive(false);
|
||||
@@ -60,6 +63,7 @@ public class AccountHandler : MonoBehaviour
|
||||
accountChangeUsername.gameObject.SetActive(false);
|
||||
accountChangePassword.gameObject.SetActive(false);
|
||||
accountRefreshLogin.gameObject.SetActive(false);
|
||||
accountForgotDetails.gameObject.SetActive(false);
|
||||
break;
|
||||
case 3:
|
||||
accountLoggedIn.gameObject.SetActive(false);
|
||||
@@ -69,6 +73,7 @@ public class AccountHandler : MonoBehaviour
|
||||
accountChangeUsername.gameObject.SetActive(false);
|
||||
accountChangePassword.gameObject.SetActive(false);
|
||||
accountRefreshLogin.gameObject.SetActive(false);
|
||||
accountForgotDetails.gameObject.SetActive(false);
|
||||
break;
|
||||
case 4:
|
||||
accountLoggedIn.gameObject.SetActive(false);
|
||||
@@ -78,6 +83,7 @@ public class AccountHandler : MonoBehaviour
|
||||
accountChangeUsername.gameObject.SetActive(true);
|
||||
accountChangePassword.gameObject.SetActive(false);
|
||||
accountRefreshLogin.gameObject.SetActive(false);
|
||||
accountForgotDetails.gameObject.SetActive(false);
|
||||
break;
|
||||
case 5:
|
||||
accountLoggedIn.gameObject.SetActive(false);
|
||||
@@ -87,6 +93,7 @@ public class AccountHandler : MonoBehaviour
|
||||
accountChangeUsername.gameObject.SetActive(false);
|
||||
accountChangePassword.gameObject.SetActive(true);
|
||||
accountRefreshLogin.gameObject.SetActive(false);
|
||||
accountForgotDetails.gameObject.SetActive(false);
|
||||
break;
|
||||
case 6:
|
||||
accountLoggedIn.gameObject.SetActive(false);
|
||||
@@ -96,6 +103,17 @@ public class AccountHandler : MonoBehaviour
|
||||
accountChangeUsername.gameObject.SetActive(false);
|
||||
accountChangePassword.gameObject.SetActive(false);
|
||||
accountRefreshLogin.gameObject.SetActive(true);
|
||||
accountForgotDetails.gameObject.SetActive(false);
|
||||
break;
|
||||
case 7:
|
||||
accountLoggedIn.gameObject.SetActive(false);
|
||||
accountLoggedOut.gameObject.SetActive(false);
|
||||
accountLogin.gameObject.SetActive(false);
|
||||
accountRegister.gameObject.SetActive(false);
|
||||
accountChangeUsername.gameObject.SetActive(false);
|
||||
accountChangePassword.gameObject.SetActive(false);
|
||||
accountRefreshLogin.gameObject.SetActive(false);
|
||||
accountForgotDetails.gameObject.SetActive(true);
|
||||
break;
|
||||
}
|
||||
foreach (CustomColorObject customColorObject in FindObjectsByType<CustomColorObject>(FindObjectsSortMode.None)) customColorObject.SetColor();
|
||||
@@ -107,6 +125,7 @@ public class AccountHandler : MonoBehaviour
|
||||
{
|
||||
if (accountChangePassword.gameObject.activeSelf || accountChangeUsername.gameObject.activeSelf || accountRefreshLogin.gameObject.activeSelf) SwitchPanel(0);
|
||||
else if (accountLogin.gameObject.activeSelf || accountRegister.gameObject.activeSelf) SwitchPanel(1);
|
||||
else if (accountForgotDetails.gameObject.activeSelf) accountForgotDetails.forgotDetailsBackButton.onClick.Invoke();
|
||||
else await SceneManager.LoadSceneAsync("MainMenu");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user