Exemple #1
0
        private static void Closed()
        {
#if TTP_POPUPMGR
            TTPPopupMgr.OnClosed("rateus");
#endif

            Debug.Log("TTPRateUs::Closed");
        }
Exemple #2
0
        static void SuggestRateUs()
        {
            Debug.Log("TTPRateUs::SuggestRateUs:");
            if (UnityEngine.Application.platform == UnityEngine.RuntimePlatform.IPhonePlayer)
            {
#if UNITY_IOS && !TTP_DEV_MODE
                ttpRateUsDisplayRateUsModal();
#endif
            }
            else
            {
#if TTP_POPUPMGR
                TTPPopupMgr.OnShown("rateus");
#endif

                UnityEngine.Object rateUsCanvasResource = Resources.Load("TTPRateUsCanvas");
                if (rateUsCanvasResource != null)
                {
                    GameObject rateUsCanvasGO = (GameObject)UnityEngine.Object.Instantiate(rateUsCanvasResource);
                    _rateUsCanvas = rateUsCanvasGO.GetComponent <TTPRateUsCanvas>();
                    _rateUsCanvas.Init(
                        () =>
                    {
                        GoToRateFromPopup();
                    },
                        () =>
                    {
                        Never(true);
                    },
                        () =>
                    {
                        Later();
                    },
                        () =>
                    {
                        Closed();
                    },
                        IconFileExtenstion
                        );
                }
            }
        }
Exemple #3
0
        private static bool ShouldSuggestRateUs()
        {
            Debug.Log("TTPRateUs::ShouldSuggestRateUs:");
            if (!TTPCore.IsConnectedToTheInternet())
            {
                LogPopUpEvent("rateUsPopup", false, false, false, true, "NA");
                Debug.Log("TTPRateUs::ShouldSuggestRateUs: not connected to the internet. will not show.");
                return(false);
            }
            if (_neverShow)
            {
                LogPopUpEvent("rateUsPopup", false, true, false, false, "NA");
                Debug.Log("TTPRateUs::ShouldSuggestRateUs: neverShow marked. will not show.");
                return(false);
            }
            if (PlayerPrefs.GetInt(PLAYER_PREFS_NEVER, 0) == 1)
            {
                LogPopUpEvent("rateUsPopup", false, true, false, false, "NA");
                Debug.Log("TTPRateUs::ShouldSuggestRateUs: neverShow marked in persistency. will not show.");
                Never(true);
                return(false);
            }
            if (NextShowTime != null && DateTime.Now.CompareTo(NextShowTime) < 0)
            {
                LogPopUpEvent("rateUsPopup", false, false, true, false, "NA");
                Debug.Log("TTPRateUs::ShouldSuggestRateUs: coolDown has not passed. will not show.");
                return(false);
            }
#if TTP_POPUPMGR
            if (!TTPPopupMgr.ShouldShow("RateUs"))
            {
                Debug.Log("TTPRateUs::ShouldSuggestRateUs: PopupMgr return false. will not show.");
                return(false);
            }
#endif
            return(true);
        }