Пример #1
0
    private void CloseQuitGameDialog()
    {
        if (closeGameDialog == null)
        {
            return;
        }

        closeGameDialog.CloseDialog();
        closeGameDialog = null;
        // Must not immediately focus next button or it will trigger as well
        StartCoroutine(CoroutineUtils.ExecuteAfterDelayInFrames(1, () => quitButton.Focus()));
    }
Пример #2
0
    private void OpenQuitGameDialog()
    {
        if (closeGameDialog != null)
        {
            return;
        }

        closeGameDialog = new SimpleUxmlDialog(
            quitGameDialogUxml,
            uiDoc.rootVisualElement,
            I18NManager.GetTranslation(R.String.mainScene_quitDialog_title),
            I18NManager.GetTranslation(R.String.mainScene_quitDialog_message));
        Button yesButton = closeGameDialog.AddButton(I18NManager.GetTranslation(R.String.yes), () => ApplicationUtils.QuitOrStopPlayMode());

        yesButton.Focus();
        closeGameDialog.AddButton(I18NManager.GetTranslation(R.String.no), () => CloseQuitGameDialog());
    }