Exemple #1
0
    public static void InfoBox(string title, string message)
    {
        MNPopup popup = new MNPopup(title, message);

        popup.AddAction("Continue", () => { Debug.Log("Ok action callback"); });
        popup.AddDismissListener(() => { Debug.Log("dismiss listener"); });
        popup.Show();
    }
Exemple #2
0
    public static void TransitionalPopUp(string title, string message)
    {
        // Always transitions to world!
        MNPopup popup = new MNPopup(title, message);

        popup.AddAction("Continue", () => { GameController.SwitchToWorld(); });
        popup.AddDismissListener(() => { GameController.SwitchToWorld(); });
        popup.Show();
    }
Exemple #3
0
 // BackToMap
 public void AskBackToMap()
 {
     if (!cancelWindowOpen)
     {
         cancelWindowOpen = true;
         MNPopup p = new MNPopup("Retour", "Voulez-vous retourner à la carte ?");
         p.AddAction("Oui", () => { leavingWindowOpen = false; BackToMap(); });
         p.AddAction("Non", () => { leavingWindowOpen = false; });
         p.AddDismissListener(() => { leavingWindowOpen = false; });
         p.Show();
     }
 }
Exemple #4
0
 //////////////// Pop-up windows
 // Leave
 public void AskLeave()
 {
     if (!leavingWindowOpen)
     {
         leavingWindowOpen = true;
         MNPopup p = new MNPopup("Quitter", "Voulez-vous quitter l'application ?");
         p.AddAction("Oui", () => { Leave(); });
         p.AddAction("Non", () => { leavingWindowOpen = false; });
         p.AddDismissListener(() => { leavingWindowOpen = false; });
         p.Show();
     }
 }
Exemple #5
0
    void OnGUI()
    {
        UpdateToStartPos();

        GUI.Label(new Rect(StartX, StartY, Screen.width, 40), "Native Pop Ups", style);
        StartY += YLableStep;

        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Rate PopUp with events"))
        {
            MNRateUsPopup rateUs = new MNRateUsPopup("rate us", "rate us, please", "Rate Us", "No, Thanks", "Later");
            rateUs.SetAppleId(appleId);
            rateUs.SetAndroidAppUrl(androidAppUrl);
            rateUs.AddDeclineListener(() => { Debug.Log("rate us declined"); });
            rateUs.AddRemindListener(() => { Debug.Log("remind me later"); });
            rateUs.AddRateUsListener(() => { Debug.Log("rate us!!!"); });
            rateUs.AddDismissListener(() => { Debug.Log("rate us dialog dismissed :("); });
            rateUs.Show();
        }

        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Dialog PopUp"))
        {
            MNPopup popup = new MNPopup("title", "dialog message");
            popup.AddAction("action1", () => { Debug.Log("action 1 action callback"); });
            popup.AddAction("action2", () => { Debug.Log("action 2 action callback"); });
            popup.AddDismissListener(() => { Debug.Log("dismiss listener"); });
            popup.Show();
        }

        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Message PopUp"))
        {
            MNPopup popup = new MNPopup("title", "dialog message");
            popup.AddAction("Ok", () => { Debug.Log("Ok action callback"); });
            popup.AddDismissListener(() => { Debug.Log("dismiss listener"); });
            popup.Show();
        }

        StartY += YButtonStep;
        StartX  = XStartPos;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Show Prealoder"))
        {
            MNP.ShowPreloader("Title", "Message");
            Invoke("OnPreloaderTimeOut", 3f);
        }

        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Hide Prealoder"))
        {
            MNP.HidePreloader();
        }
    }
Exemple #6
0
    public void ShowDialog(string title, string message)
    {
        //MNPopup popup = new MNPopup("title", "dialog message");
        MNPopup popup = new MNPopup(title, message);

        popup.AddAction("Ok", () => {
            Debug.Log("OK action callback");
        });
        popup.AddAction("Cancel", () => {
            Debug.Log("Cancel action callback");
        });
        popup.AddDismissListener(() => {
            Debug.Log("dismiss listener");
        });
        popup.Show();
    }
Exemple #7
0
    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 void AddDismissListener(Action callback)
 {
     popUp.AddDismissListener(() => callback());
 }