Class Dialog
Namespace: Microsoft.MixedReality.Toolkit.Experimental.Dialog
Assembly: cs.temp.dll.dll
Syntax
public abstract class Dialog : MonoBehaviour
Fields
OnClosed
Called after user has clicked a button and the dialog has finished closing
Declaration
public Action<DialogResult> OnClosed
Field Value
Type | Description |
---|---|
Action<DialogResult> |
result
Declaration
protected DialogResult result
Field Value
Type | Description |
---|---|
DialogResult |
Properties
Result
Can be used to monitor result instead of events
Declaration
public DialogResult Result { get; }
Property Value
Type | Description |
---|---|
DialogResult |
State
The current state of the Dialog.
Declaration
public DialogState State { get; set; }
Property Value
Type | Description |
---|---|
DialogState |
Methods
CloseDialog()
Closes the dialog - state must be set to Closed afterwards
Declaration
protected virtual IEnumerator CloseDialog()
Returns
Type | Description |
---|---|
IEnumerator |
FinalizeLayout()
This is called after the buttons are generated and the title and message have been set. Perform here any operations that you'd like Lays out the buttons on the dialog E.g. using an ObjectCollection
Declaration
protected abstract void FinalizeLayout()
GenerateButtons()
Generates buttons - Must parent them under buttonParent!
Declaration
protected abstract void GenerateButtons()
Launch(DialogResult)
Declaration
protected void Launch(DialogResult newResult)
Parameters
Type | Name | Description |
---|---|---|
DialogResult | newResult |
Open(GameObject, DialogButtonType, String, String, Boolean, Object)
Instantiates a dialog and passes a generated result
Declaration
public static Dialog Open(GameObject dialogPrefab, DialogButtonType buttons, string title, string message, bool placeForNearInteraction, object variable = null)
Parameters
Type | Name | Description |
---|---|---|
GameObject | dialogPrefab | Dialog prefab |
DialogButtonType | buttons | button configuration type which is defined in DialogButtonType enum |
String | title | Title text of the dialog |
String | message | Description text of the dialog |
Boolean | placeForNearInteraction | |
Object | variable | Object with additional variable |
Returns
Type | Description |
---|---|
Dialog |
Open(GameObject, DialogResult)
Instantiates a dialog and passes it a result
Declaration
public static Dialog Open(GameObject dialogPrefab, DialogResult result)
Parameters
Type | Name | Description |
---|---|---|
GameObject | dialogPrefab | Dialog prefab |
DialogResult | result | DialogResult class object which contains information such as title and description text |
Returns
Type | Description |
---|---|
Dialog |
OpenDialog()
Opens the dialog - state must be set to WaitingForInput afterwards Overridden in inherited class. Perform any change here that you'd like to have when the dialog opened.
Declaration
protected virtual IEnumerator OpenDialog()
Returns
Type | Description |
---|---|
IEnumerator |
RunDialogOverTime()
Opens dialog, waits for input, then closes
Declaration
protected IEnumerator RunDialogOverTime()
Returns
Type | Description |
---|---|
IEnumerator |
SetTitleAndMessage()
Set the title and message using the result E.g. using TextMesh components
Declaration
protected abstract void SetTitleAndMessage()
UpdateDialog()
Perform any updates (animation, tagalong, etc) here This will be called every frame while waiting for input
Declaration
protected virtual void UpdateDialog()