// Update is called once per frame void Update() { bool nextScreen = Input.GetButtonDown("Submit"); if (CurScreen == 5) { nextScreen = Input.GetKeyDown(KeyCode.Return) && UserNameInput.text.Length > 0; } if (CurScreen == 6) { // Also allow a user to press cancel to skip having a phone connected nextScreen = Client.PhoneConnected || Input.GetButtonDown("Cancel"); } if (nextScreen) { if (SkipToGame) { SceneManager.LoadScene("Level"); return; } Screens[CurScreen].gameObject.SetActive(false); if (CurScreen == 5) { Client.UserName = UserNameInput.text; Client.DoOpen(); } CurScreen++; if (CurScreen == 6) { UrlText.text = UrlText.text.Replace("USERNAME", Client.UserName); } if (CurScreen < Screens.Count) { Screens[CurScreen].gameObject.SetActive(true); } else { SceneManager.LoadScene("Level"); } } }