void ConnectionPopUp(string errorMessage) { UnityEngine.GUI.Box(new Rect(Screen.width / 2 - width / 2, Screen.height / 2 - height / 2, width, height), errorMessage, GUIStyles.QRStyle(Screen.height, Screen.width)); if (UnityEngine.GUI.Button(new Rect(Screen.width / 2 - width / 2, Screen.height / 2 - height / 4, width, height), "Tap to return to QR scanner", GUIStyles.ButtonStyle(Screen.height - height, Screen.width - width))) { Application.LoadLevel("QRCodeScene"); } }
void OnGUI() { GUI.Box(new Rect(0, Screen.height - Screen.height * 0.05f, Screen.width, Screen.height * 0.1f), qrText, GUIStyles.QRStyle(Screen.height, Screen.width)); GUI.Box(new Rect(0, 0, Screen.width, Screen.height * 0.1f), "Scan the QR code to join the game", GUIStyles.QRStyle(Screen.height, Screen.width)); if (Input.GetKeyDown(KeyCode.Escape)) { Application.Quit(); } }