Skip to content

Latest commit

 

History

History
92 lines (65 loc) · 1.33 KB

README.md

File metadata and controls

92 lines (65 loc) · 1.33 KB

AlertConfirmDialog

⚠️ Display simple alert and confirm dialogs on both iOS and Android.

npm

Installation

Unity Package Manager

https://docs.unity3d.com/Packages/com.unity.package-manager-ui@2.0/manual/index.html

Git

{
  "dependencies": {
    "xyz.candycoded.alertconfirmdialog": "https://github.com/CandyCoded/alertconfirmdialog.git#v1.0.1",
    ...
  }
}

Scoped UPM Registry

{
  "dependencies": {
    "xyz.candycoded.alertconfirmdialog": "1.0.1",
    ...
  },
  "scopedRegistries": [
    {
      "name": "candycoded",
      "url": "https://registry.npmjs.com",
      "scopes": ["xyz.candycoded"]
    }
  ]
}

Usage

First include the package.

using CandyCoded.AlertConfirmDialog;

Alert

AlertConfirmDialog.Alert("Title", "Message");
AlertConfirmDialog.Alert("Title", "Message", () =>
{

    Debug.Log("Ok");

});

Confirm

AlertConfirmDialog.Confirm("Title", "Message");
AlertConfirmDialog.Confirm("Title", "Message", () =>
{

    Debug.Log("Ok");

});
AlertConfirmDialog.Confirm("Title", "Message", () =>
{

    Debug.Log("Ok");

}, () =>
{

    Debug.Log("Cancel");

});