IEnumerator DoOutro() { GameManager.Instance.game.standardView.CloseWithAnim(); GameManager.Instance.game.avatar.Disappear(); yield return(new WaitForSeconds(0.6f)); CanvasGroup group = OutroObj.GetComponent <CanvasGroup>(); group.alpha = 0; OutroObj.SetActive(true); while (group.alpha < 1) { group.alpha += Time.deltaTime; } yield return(new WaitForSeconds(3f)); MNRateUsPopup rateUs = new MNRateUsPopup("Rate Us", "Like the game? \nRate us on Play Store", "RATE GAME", "NO, THANKS"); 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(); FacebookThing.SetActive(true); }
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(); } }
public void OnRateButton() { MNRateUsPopup rateUs = new MNRateUsPopup("Rate Us", "Are you enjoying \n Space Flight? \n Please rate us! ", "Rate", "No, Thanks", "Later"); blockPanel.SetActive(true); rateUs.SetAppleId(appleId); rateUs.SetAndroidAppUrl(androidAppUrl); rateUs.AddDeclineListener(() => { Debug.Log("rate us declined"); CloseBlockPanel(); }); rateUs.AddRemindListener(() => { Debug.Log("remind me later"); CloseBlockPanel(); }); rateUs.AddRateUsListener(() => { Debug.Log("rate us!!!"); CloseBlockPanel(); }); rateUs.AddDismissListener(() => { Debug.Log("rate us dialog dismissed :("); CloseBlockPanel(); }); rateUs.Show(); }
public void AddRateUsListener(Action callback) { popUp.AddRateUsListener(() => callback()); }