Manages a modal dialog which can be presented to the user.
public class ModalDialog : Sansar.Script.InstanceInterfaceRemarks
Set the message and the button text.
Members at a glance
| Kind | Members |
|---|---|
| Properties | Message · Response |
| Methods | Cancel · Show · ToString |
Properties
Message
public string Message { get; }The message displayed on the dialog.
Value: string — The string displayed on the dialog.
Remarks
This is set by the ModalDialog.Show method upon creation.
Response
public string Response { get; }The response from the last ModalDialog.Show call.
Value: string — String response from the last show call.
Remarks
This value will be valid after the event occurs.
Methods
Cancel
public void Cancel()Cancels any existing dialog.
Remarks
Does not generate an event.
Show
public void Show(
string message,
string leftButton,
string rightButton
)Shows a Modal Dialog on the screen.
| Parameter | Type | Description |
|---|---|---|
message | string | Text of the dialog. |
leftButton | string | Text of the left button. |
rightButton | string | Text of the right button. |
Remarks
Call this with ScriptBase.WaitFor in a coroutine to block until the event is generated.
[System.Obsolete("Deprecated. Use the Action<> overload", false)]
public ulong Show(
string message,
string leftButton,
string rightButton,
Sansar.Script.ScriptBase.OperationComplete handler
)Shows a Modal Dialog on the screen.
| Parameter | Type | Description |
|---|---|---|
message | string | Text of the dialog. |
leftButton | string | Text of the left button. |
rightButton | string | Text of the right button. |
handler | Sansar.Script.ScriptBase.OperationComplete | Handler to be called when the event completes. |
Returns: ulong — The internal event id for the completion event.
Remarks
Call this with ScriptBase.WaitFor in a coroutine to block until the event is generated.
public void Show(
string message,
string leftButton,
string rightButton,
Action<Sansar.Script.OperationCompleteEvent> handler
)Shows a Modal Dialog on the screen.
| Parameter | Type | Description |
|---|---|---|
message | string | Text of the dialog. |
leftButton | string | Text of the left button. |
rightButton | string | Text of the right button. |
handler | Action<Sansar.Script.OperationCompleteEvent> | Handler to be called when the event completes. |
Remarks
Call this with ScriptBase.WaitFor in a coroutine to block until the event is generated.
ToString
public override string ToString()A string representation of this object.
Returns: string — A string representation of this object.
Remarks
The format of this string may change between releases.
Used in examples
- MoverExample1.cs
- StatsExample.cs
- VisitorTrackerExample.cs
- BanHammerExample.cs
- ScriptLibrary/Scene/Prompt.cs
Generated from the Sansar 47.10.0 client ScriptApi snapshot.