Ejemplo n.º 1
0
 private void OnLoginResponse(LoginResponse response, ErrorResponse error)
 {
     if (error != null)
     {
         if (response.responseCode == LoginResponse.ResponseCode.DownForMaintenance && response.hasAdminAccess)
         {
             // Allow admin user the option to override the maintenance block
             ConfirmDialog.Create(OnOverrideDialogResponse, "Down For Maintenance", error.ToString(), "Override");
         }
         else if (response.responseCode == LoginResponse.ResponseCode.BadVersion)
         {
             // Allow user to update app version
             ConfirmDialog.Create(OnUpdateDialogResponse, "Update Required", error.ToString(), "Download");
         }
         else
         {
             // Other errors that always restore the login screen
             Debug.LogError(error.ToDeveloperMessage(true));
             InfoDialog.Create("", error.ToString(), OnCloseInfoDialog);
         }
     }
     else
     {
         if (!response.emailVerified)
         {
             ConfirmDialog.Create(OnClick_ResendEmail, "Email Not Yet Verified", "Your email has not yet been verified. You must confirm your email address to upload content."
                                  + "\n\nWould you like to resend the confirmation email?", "Resend");
         }
         else
         {
             // Success. Close login dialog.
             OnClick_Close();
         }
     }
 }
Ejemplo n.º 2
0
        public static ConfirmDialog Create(OnDialogCallback cb, string title, string body, string submit = "OK", string cancel = "Cancel")
        {
            GameObject    goDlg = Instantiate(Resources.Load <GameObject>("Dialogs/CanvasConfirmDialog"));
            ConfirmDialog dlg   = goDlg.GetComponent <ConfirmDialog>();

            dlg.Initialize(cb, title, body, submit, cancel);

            return(dlg);
        }