public void Show(MobileSystemDialog mobileSystemDialog) { if (mobileSystemDialog.Buttons.Count <= 0 || mobileSystemDialog.Buttons.Count > 3 || !(Application.platform == RuntimePlatform.WindowsEditor || Application.platform == RuntimePlatform.OSXEditor || Application.platform == RuntimePlatform.LinuxEditor)) { return; } switch (mobileSystemDialog.Buttons.Count) { case 1: if (EditorUtility.DisplayDialog(mobileSystemDialog.TitleText, mobileSystemDialog.BodyText, mobileSystemDialog.Buttons[0].ButtonLabel, string.Empty)) { mobileSystemDialog.Buttons[0].Action(); } break; case 2: if (EditorUtility.DisplayDialog(mobileSystemDialog.TitleText, mobileSystemDialog.BodyText, mobileSystemDialog.Buttons[0].ButtonLabel, mobileSystemDialog.Buttons[1].ButtonLabel)) { mobileSystemDialog.Buttons[0].Action(); } else { mobileSystemDialog.Buttons[1].Action(); } break; case 3: var option = EditorUtility.DisplayDialogComplex( mobileSystemDialog.TitleText, mobileSystemDialog.BodyText, mobileSystemDialog.Buttons[0].ButtonLabel, mobileSystemDialog.Buttons[1].ButtonLabel, mobileSystemDialog.Buttons[2].ButtonLabel); switch (option) { case 0: case 1: case 2: mobileSystemDialog.Buttons[option].Action(); break; default: _debugService.Log("Dialog unrecognized option."); break; } break; } }
public void Show(MobileSystemDialog mobileSystemDialog) { if (Application.platform != RuntimePlatform.IPhonePlayer) { return; } _mobileSystemDialog = mobileSystemDialog; EtceteraManager.alertButtonClickedEvent += OnDialogCloseIphone; EtceteraBinding.showAlertWithTitleMessageAndButtons( _mobileSystemDialog.TitleText, _mobileSystemDialog.BodyText, _mobileSystemDialog.Buttons.Select(a => a.ButtonLabel).ToArray()); }
public void Show(MobileSystemDialog mobileSystemDialog) { if (Application.platform != RuntimePlatform.Android) { return; } var message = new MNPopup(mobileSystemDialog.TitleText, mobileSystemDialog.BodyText); foreach (var button in mobileSystemDialog.Buttons) { message.AddAction(button.ButtonLabel, () => { button.Action(); }); } message.AddDismissListener(() => { if (mobileSystemDialog.OnDissmiss != null) { mobileSystemDialog.OnDissmiss.Invoke(); } }); message.Show(); }
public virtual void ShowLostInternetMessage(LostInternetMessage messageType, Action onClose = null) { if (messageType == LostInternetMessage.none) { return; } MobileSystemDialog errorMessage = null; switch (messageType) { case LostInternetMessage.buy: errorMessage = new MobileSystemDialog( _localizationController.GetText("Common.Allert.Attention"), _localizationController.GetText("InternetLost.Buy"), new List <MobileSystemDialogButton> { new MobileSystemDialogButton("OK", () => { if (onClose != null) { onClose.Invoke(); } }) }, () => { if (onClose != null) { onClose.Invoke(); } }); break; case LostInternetMessage.restore: errorMessage = new MobileSystemDialog( _localizationController.GetText("Common.Allert.Attention"), _localizationController.GetText("InternetLost.Restore"), new List <MobileSystemDialogButton> { new MobileSystemDialogButton("OK", () => { if (onClose != null) { onClose.Invoke(); } }) }, () => { if (onClose != null) { onClose.Invoke(); } }); break; case LostInternetMessage.transition: errorMessage = new MobileSystemDialog( _localizationController.GetText("Common.Allert.Attention"), _localizationController.GetText("InternetLost.Transition"), new List <MobileSystemDialogButton> { new MobileSystemDialogButton("OK", () => { if (onClose != null) { onClose.Invoke(); } }) }, () => { if (onClose != null) { onClose.Invoke(); } }); break; case LostInternetMessage.watchAds: errorMessage = new MobileSystemDialog( _localizationController.GetText("Common.Allert.Attention"), _localizationController.GetText("InternetLost.Transition.WatchAds"), new List <MobileSystemDialogButton> { new MobileSystemDialogButton("OK", () => { if (onClose != null) { onClose.Invoke(); } }) }, () => { if (onClose != null) { onClose.Invoke(); } }); break; } _systemDialogService.Show(errorMessage); }
public void Show(MobileSystemDialog mobileSystemDialog) { }