Essential Kit
Loading...
Searching...
No Matches
AlertDialog

The AlertDialog class provides an interface to display an alert message to the user. More...

Public Member Functions

void AddTextInputField (TextInputFieldOptions options=null)
 Adds a text input field to the alert.
 
void AddButton (string title, Callback callback)
 Adds an action button to the alert. Here, the default style is used.
 
void AddButton (string title, Callback< string[]> callback)
 Adds an action button to the alert. Here, the default style is used.
 
void AddCancelButton (string title, Callback callback)
 Adds action button to the alert. This style type indicates the action cancels the operation and leaves things unchanged.
 
void Show ()
 Shows the alert dialog to the user.
 
void Dismiss ()
 Dismisses the alert dialog before user selects an action.
 

Static Public Member Functions

static AlertDialog CreateInstance (AlertDialogStyle alertStyle=AlertDialogStyle.Default)
 Creates a new instance of the AlertDialog class.
 

Properties

string Title [get, set]
 The title of the alert.
 
string Message [get, set]
 The message of the alert.
 

Detailed Description

The following code example shows how to configure and present an alert dialog.

using UnityEngine;
using System.Collections;
public class ExampleClass : MonoBehaviour
{
public void Start()
{
newDialog.SetTitle(title);
newDialog.SetMessage(message);
newDialog.AddButton(button, OnAlertButtonClicked);
newDialog.Show();
}
private void OnAlertButtonClicked()
{
// add your code
}
}
The AlertDialog class provides an interface to display an alert message to the user.
Definition AlertDialog.cs:46
void AddButton(string title, Callback callback)
Adds an action button to the alert. Here, the default style is used.
Definition AlertDialog.cs:186
static AlertDialog CreateInstance(AlertDialogStyle alertStyle=AlertDialogStyle.Default)
Creates a new instance of the AlertDialog class.
Definition AlertDialog.cs:113
void Show()
Shows the alert dialog to the user.
Definition AlertDialog.cs:217
Namespace for essential kit features. You need to import this namespace along with VoxelBusters....
Definition AddressBook.cs:8

Member Function Documentation

◆ CreateInstance()

static AlertDialog CreateInstance ( AlertDialogStyle alertStyle = AlertDialogStyle::Default)
static
Parameters
alertStyleThe alert style to be used.

Referenced by AlertDialogBuilder.AlertDialogBuilder().

◆ AddTextInputField()

void AddTextInputField ( TextInputFieldOptions options = null)
Parameters
optionsThe options for the text input field built with TextInputFieldOptions.Builder.

Referenced by AlertDialogBuilder.AddTextInputField().

◆ AddButton() [1/2]

void AddButton ( string title,
Callback callback )
Parameters
titleThe title of the button.
callbackThe method to execute when the user selects this button.

Referenced by AlertDialogBuilder.AddButton(), and AlertDialogBuilder.AddButton().

◆ AddButton() [2/2]

void AddButton ( string title,
Callback< string[]> callback )
Parameters
titleThe title of the button.
callbackThe method to execute when the user selects this button which returns array of input text values, if any.

◆ AddCancelButton()

void AddCancelButton ( string title,
Callback callback )
Parameters
titleThe title of the button.
callbackThe method to execute when the user selects this button.

Referenced by AlertDialogBuilder.AddCancelButton().

Property Documentation

◆ Title

string Title
getset

The title of the alert.

◆ Message

string Message
getset

The message of the alert.