コード例 #1
0
        private static Task Show(string caption, string message, string dialogPrefabName)
        {
            var        dialog   = new DialogLoader <Dialog>(new Dialog(caption, message));
            GameObject dialogUi = dialog.LoadDialogPrefab(new DefaultPresenter(), dialogPrefabName);

            RootCanvas.GetOrAddRootCanvas().gameObject.AddChild(dialogUi); // Add dialog UI in a canvas
            return(dialog.ShowDialogAsync());
        }
コード例 #2
0
        public static async Task <bool> Show(string caption, string message, string confirmBtnText = null, string dialogPrefabName = "Dialogs/DefaultDialog2")
        {
            var        loader   = new DialogLoader <ConfirmCancelDialog>(new ConfirmCancelDialog(caption, message, confirmBtnText));
            GameObject dialogUi = loader.LoadDialogPrefab(new DefaultPresenter(), dialogPrefabName);

            RootCanvas.GetOrAddRootCanvas().gameObject.AddChild(dialogUi); // Add dialog UI in a canvas
            ConfirmCancelDialog dialog = await loader.ShowDialogAsync();

            return(dialog.dialogWasConfirmed);
        }
コード例 #3
0
        private static Task Show(string caption, string message, string confirmText, string dialogPrefabName)
        {
            var        dialog   = new DialogLoader <Dialog>(new Dialog(caption, message, confirmText));
            GameObject dialogUi = dialog.LoadDialogPrefab(new DefaultPresenter(), dialogPrefabName);

            RootCanvas.GetOrAddRootCanvas().gameObject.AddChild(dialogUi); // Add dialog UI in a canvas
            var d = dialog.ShowDialogAsync();

            EventBus.instance.Publish(EventConsts.catUi + UiEvents.DIALOG, dialog);
            return(d);
        }
コード例 #4
0
        public static async Task <bool> Show(string caption, string message, string confirmBtnText = null, string dialogPrefabName = "Dialogs/DefaultDialog2")
        {
            var        loader     = new DialogLoader <ConfirmCancelDialog>(new ConfirmCancelDialog(caption, message, confirmBtnText));
            var        rootCanvas = RootCanvas.GetOrAddRootCanvasV2().gameObject;
            GameObject dialogUi   = loader.LoadDialogPrefab(new DefaultPresenter(), dialogPrefabName);

            rootCanvas.AddChild(dialogUi); // Add dialog UI in a canvas
            ConfirmCancelDialog dialog = await loader.ShowDialogAsync();

            EventBus.instance.Publish(EventConsts.catUi + UiEvents.CONFIRM_CANCEL_DIALOG, dialog);
            return(dialog.dialogWasConfirmed);
        }