public void Close(PopupBase popup)
    {
        popup.Close();
        Destroy(popup.gameObject);

        // barrier
        barrier.raycastTarget = false;
    }
 /// <summary>
 /// Sets the DialogResult property of the popup.</summary>
 private void SetPopupResult(DialogResult dialogResult)
 {
     Result = dialogResult;
     window.Close();
 }