public void Show(string message, PlatformDialog.Type buttonType) { string labelPositive = null; string labelNegative = null; if (buttonType == PlatformDialog.Type.SubmitOnly) { labelPositive = GetLabelPositiveButton(); } else { labelPositive = GetLabelPositiveButton(); labelNegative = GetLabelNegativeButton(); } if (EditorUtility.DisplayDialog(" ", message, labelPositive, labelNegative)) { PlatformDialog.Instance.gameObject.SendMessage("OnPositive", "positive"); } else { PlatformDialog.Instance.gameObject.SendMessage("OnNegative", "negative"); } }
public void Show(string message, PlatformDialog.Type buttonType) { if (buttonType == PlatformDialog.Type.SubmitOnly) { Application.ExternalEval(javascriptAlert.Replace("MESSAGE", message)); } else { Application.ExternalEval(javascriptConfirm.Replace("MESSAGE", message)); } }
/// <summary> Show Platform Dialog with title</summary> /// <remarks> You can display the title, only Android and iOS. Not supported UnityEditor and Web Player. /// <param name='title'> dialog title </param> /// <param name='message'> dialog message </param> /// <param name='buttonType'> dialog button type : submit only or OK and Cancel </param> /// <param name='positiveDelegate'> delegate: on click positive button </param> /// <param name='negativeDelegate'> delegate: on click negative button </param> public static void Show(string title, string message, PlatformDialog.Type buttonType, Action positiveDelegate, Action negativeDelegate = null) { switch (buttonType) { case PlatformDialog.Type.SubmitOnly: Instance.positiveDelegate = positiveDelegate; Instance.negativeDelegate = positiveDelegate; break; default: Instance.positiveDelegate = positiveDelegate; Instance.negativeDelegate = negativeDelegate; break; } Instance.dialog.Show(title, message, buttonType); }
public void Show(string message, PlatformDialog.Type buttonType) { using (AndroidJavaClass javaClass = new AndroidJavaClass("unity.plugins.dialog.NativeDialog")) { javaClass.CallStatic("ShowDialog", message, buttonType.ToInt()); } }
public void Show(string title, string message, PlatformDialog.Type buttonType) { }
public static int ToInt(this PlatformDialog.Type type) { return((int)type); }
public void Show(string title, string message, PlatformDialog.Type buttonType) { DialogShowWithTitle(title, message, buttonType.ToInt()); }
public void Show(string message, PlatformDialog.Type buttonType) { DialogShowWithMessage(message, buttonType.ToInt()); }