Exemplo n.º 1
0
 public void QuitGame()
 {
     ApplicationUtils.QuitOrStopPlayMode();
 }
Exemplo n.º 2
0
 void Start()
 {
     GetComponent <Button>().OnClickAsObservable()
     .Subscribe(_ => ApplicationUtils.QuitOrStopPlayMode());
 }
Exemplo n.º 3
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());
    }
Exemplo n.º 4
0
    public void OpenQuitGameDialog()
    {
        if (quitGameDialogControl != null)
        {
            return;
        }

        VisualElement visualElement = quitGameDialogUi.CloneTree();

        visualElement.AddToClassList("overlay");
        uiDocument.rootVisualElement.Add(visualElement);

        quitGameDialogControl = injector
                                .WithRootVisualElement(visualElement)
                                .CreateAndInject <MessageDialogControl>();
        quitGameDialogControl.Title   = TranslationManager.GetTranslation(R.Messages.mainScene_quitDialog_title);
        quitGameDialogControl.Message = TranslationManager.GetTranslation(R.Messages.mainScene_quitDialog_message);

        quitGameDialogControl.AddButton(TranslationManager.GetTranslation(R.Messages.no), () => CloseQuitGameDialog());
        Button yesButton = quitGameDialogControl.AddButton(TranslationManager.GetTranslation(R.Messages.yes), () => ApplicationUtils.QuitOrStopPlayMode());

        yesButton.Focus();
    }