public void Button() { // If there is less than 4 chars if (tmpi.text.Length <= 3) { StartCoroutine(Flash("Minimum 4 Letters!")); } // If there is more than 16 chars else if (tmpi.text.Length > 16) { StartCoroutine(Flash("Max 16 Chars!")); } // If there is Asterisk else if (tmpi.text.Contains("*")) { StartCoroutine(Flash("No Asterisks!")); } // If colour is black else if (PlayerPrefs.GetString("Colour") == "0_0_0_") { StartCoroutine(Flash("Your Fav Colour Can't Be Black")); } //Submit else { PlayerPrefs.SetString("username", tmpi.text); uip.funcshow(); //SceneManager.LoadScene("Title"); } }
IEnumerator Create(string eml, string pwd) { yield return(null); var localemail = emlf.text; var localpassword = passf.text; if (localemail.Length < 4) { err.text = "Please enter a valid email address."; uip.funcshow(); yield return(new WaitForSeconds(5)); SceneManager.LoadScene(SceneManager.GetActiveScene().name); } if (localpassword.Length < 4) { err.text = "Please enter a valid email password."; uip.funcshow(); yield return(new WaitForSeconds(5)); SceneManager.LoadScene(SceneManager.GetActiveScene().name); } if (!localemail.Contains("@")) { err.text = "Emails must include an @."; uip.funcshow(); yield return(new WaitForSeconds(5)); SceneManager.LoadScene(SceneManager.GetActiveScene().name); } if (localemail.Contains("*") | localemail.Contains("/") | localemail.Contains(":")) { err.text = "illegal email."; uip.funcshow(); yield return(new WaitForSeconds(5)); SceneManager.LoadScene(SceneManager.GetActiveScene().name); } if (localpassword.Contains("*") | localpassword.Contains("/") | localpassword.Contains(":")) { err.text = "illegal password."; uip.funcshow(); yield return(new WaitForSeconds(5)); SceneManager.LoadScene(SceneManager.GetActiveScene().name); } //check if user already exists StartCoroutine(GetRequest("http://dreamlo.com/lb/5facda3beb371a09c4e55e13/pipe")); while (string.IsNullOrEmpty(PlayerPrefs.GetString("response"))) { yield return(null); } if (PlayerPrefs.GetString("response").Contains(localemail.ToLower())) { PlayerPrefs.SetString("response", null); err.text = "Email is already in use."; uip.funcshow(); yield return(new WaitForSeconds(5)); SceneManager.LoadScene(SceneManager.GetActiveScene().name); } else { PlayerPrefs.SetString("response", null); } //sign up var req = "http://dreamlo.com/lb/EDAdn1faykyG0H1B0YCHgwReYOwo0X6k2c0HiateZhvw/add/" + localemail.ToLower() + "$" + localpassword + "/100"; StartCoroutine(GetRequest(req)); print("Signed Up: " + req); PlayerPrefs.SetString("response", null); PlayerPrefs.SetString("email", localemail.ToLower()); PlayerPrefs.SetString("password", localpassword); changeLogin(localemail); }