I’m trying to make a login screen for my game. cant get this loop to work though.
just trying to check to see if the username matches the one that was inputted with the userNameCheck variable.
Currently when i run the loop the game freezes. so im thinking the null isn’t working somehow.
can someone help? thanks.
here is an image of the login screen:
void CheckForUser()
{
do
{
userNameCheck = File.ReadAllText(path);
if (userNameCheck == userNameText)
{
this.FoundUser();
}
}
while (userNameCheck != null);
//user dosent exist
UnityEngine.Debug.Log ("Did not find user");
}
void FoundUser()
{
UnityEngine.Debug.Log ("Found User");
}