Прочетете на английски Редактиране

Споделяне чрез


Dialog Class

Definition

C++
public ref class Dialog abstract : UnityEngine::MonoBehaviour
Inheritance
UnityEngine.MonoBehaviour
Dialog
Derived

Constructors

Fields

OnClosed

Called after user has clicked a button and the dialog has finished closing

result

Properties

Result

Can be used to monitor result instead of events

State

The current state of the Dialog.

Methods

CloseDialog()

Closes the dialog - state must be set to Closed afterwards

DismissDialog()

Function to destroy the Dialog.

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

GenerateButtons()

Generates buttons - Must parent them under buttonParent!

Launch(DialogResult)
Open(GameObject, DialogButtonType, String, String, Boolean, Object)

Instantiates a dialog and passes a generated result

Open(GameObject, DialogResult)

Instantiates a dialog and passes it a result

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.

RunDialogOverTime()

Opens dialog, waits for input, then closes

SetTitleAndMessage()

Set the title and message using the result E.g. using TextMesh components

UpdateDialog()

Perform any updates (animation, tagalong, etc) here This will be called every frame while waiting for input

Applies to

Продукт Версии
MRTK2 Unity 2018 2.6.0, 2.7.0
MRTK2 Unity 2019 2.6.0, 2.7.0, 2.8.0
MRTK2 Unity 2020 2.6.0, 2.7.0, 2.8.0