MessageBox async modal dialogs for Unity with UniTask. Triggers on: confirmation dialog, modal popup, prompt, alert, user confirmation, yes/no dialog, OK/Cancel, async dialog, await user input, delete confirmation, save confirmation
Built on UniTask for non-blocking async operations with automatic object pooling.
public static UniTask<bool> Show(
string title,
string content,
string ok = "OK",
string no = "Cancel"
)
Returns true for confirm, false for cancel.
MessageBox.CloseAll() - Dismiss all active dialogs (for scene transitions)MessageBox.Dispose() - Release all pooled instances (app shutdown)MessageBox.ActiveCount - Currently displayed dialogsMessageBox.PooledCount - Cached instances in poolbool confirmed = await MessageBox.Show(
"Delete Item",
"Are you sure you want to delete this item?",
ok: "Delete",
no: "Cancel"
);
if (confirmed)
{
DeleteItem();
}
bool saved = await MessageBox.Show(
"Save Changes",
"Keep your changes?",
ok: "Save",
no: "Discard"
);
// Pass null or empty string to hide cancel button
await MessageBox.Show(
"Success",
"Operation completed!",
ok: "OK",
no: null
);
MessageBox.CloseAll();
SceneManager.LoadScene("NextScene");