17 private Dialog dialogPrefab = null;
20 private bool isDialogLaunched;
23 private GameObject resultText;
28 public GameObject ResultText
43 private int numButtons = 1;
45 private TextMesh resultTextMesh;
57 isDialogLaunched =
true;
60 Dialog dialog =
Dialog.
Open(dialogPrefab.gameObject, buttons, title, message);
75 isDialogLaunched =
false;
80 private void OnEnable()
82 resultTextMesh = ResultText.GetComponent<TextMesh>();
83 button = GetComponent<Button>();
90 private void OnButtonClicked(GameObject obj)
92 if (isDialogLaunched ==
false)
97 StartCoroutine(LaunchDialog(
DialogButtonType.OK,
"Single Button Dialog",
"Dialogs and flyouts are transient UI elements that appear when something happens that requires notification, approval, or additional information from the user."));
99 else if (numButtons == 2)
102 StartCoroutine(LaunchDialog(
DialogButtonType.Yes |
DialogButtonType.No,
"Two Buttons Dialog",
"Dialogs and flyouts are transient UI elements that appear when something happens that requires notification, approval, or additional information from the user."));
114 resultTextMesh.text = result.
Result.ToString();