IWindowFunction class that prompts the user for action.
More...
|
void | Window (int windowID) |
| GUI window function for the prompt. More...
|
|
IWindowFunction class that prompts the user for action.
Definition at line 8 of file UI_Prompt.cs.
Enumerator |
---|
Close |
Close type response: display only a "Close" button.
|
YesNo |
Yes or No type response: display "Yes" and "No" buttons.
|
OkCancel |
Ok or Cancel type response: display "Ok" and "Cancel" buttons.
|
Definition at line 16 of file UI_Prompt.cs.
Close type response: display only a "Close" button.
Ok or Cancel type response: display "Ok" and "Cancel" buttons.
Yes or No type response: display "Yes" and "No" buttons.
UI_Prompt.UI_Prompt |
( |
Response |
response, |
|
|
Type |
t, |
|
|
string |
title = "Prompt" , |
|
|
string |
prompt = "Keep up the good work!" |
|
) |
| |
Initializes a new instance of the UI_Prompt class.
- Parameters
-
response | Response callback function Reponse(bool). |
t | Response Type. |
title | Title. |
prompt | Prompt. |
Definition at line 41 of file UI_Prompt.cs.
52 windowRect =
new Rect(Screen.width/2f, Screen.height/2f, 400, 100);
Response callback
The callback function to call once the user has responded to the prompt.
delegate void UI_Prompt.Response |
( |
bool |
response | ) |
|
Response callback delegate type.
void UI_Prompt.Window |
( |
int |
windowID | ) |
|
|
private |
GUI window function for the prompt.
Definition at line 88 of file UI_Prompt.cs.
94 if (GUILayout.Button(
"Close")) {
101 GUILayout.BeginHorizontal();
102 if (GUILayout.Button(
"OK")) {
106 GUILayout.Space(20f);
107 if (GUILayout.Button(
"Cancel")) {
111 GUILayout.EndHorizontal();
115 GUILayout.BeginHorizontal();
116 if (GUILayout.Button(
"Yes")) {
120 GUILayout.Space(20f);
121 if (GUILayout.Button(
"No")) {
125 GUILayout.EndHorizontal();
Response callback
The callback function to call once the user has responded to the prompt.
The callback function to call once the user has responded to the prompt.
Definition at line 82 of file UI_Prompt.cs.
GUI.WindowFunction UI_Prompt.windowFunction |
|
get |
Rect UI_Prompt.windowRect |
|
getset |
string UI_Prompt.windowTitle |
|
getset |
The documentation for this class was generated from the following file: