Exemplo n.º 1
0
        /// <summary>
        /// Call <see cref="PaperPlaneTools.RateBox.Init"/> function
        /// </summary>
        void Start()
        {
            string rateUrl = RateBox.GetStoreUrl(appStoreAppId, playMarketAppBundleId);

            //Debug settings are only allowed inside development environment
                        #if (UNITY_EDITOR)
            if (clearOnStart)
            {
                RateBox.Instance.ClearStatistics();
            }
            RateBox.Instance.DebugMode = logDebugMessages;
                        #else
            RateBox.Instance.DebugMode = false;
                        #endif

            var rejectButtonTrimmed = rejectButton.Trim();
            RateBox.Instance.Init(
                rateUrl,
                new RateBoxConditions()
            {
                MinSessionCount            = minSessionCount,
                MinCustomEventsCount       = minCustomEventsCount,
                DelayAfterInstallInSeconds = Mathf.CeilToInt(delayAfterInstallInHours * 3600),
                DelayAfterLaunchInSeconds  = Mathf.CeilToInt(delayAfterLaunchInHours * 3600),
                PostponeCooldownInSeconds  = Mathf.CeilToInt(postponeCooldownInHours * 3600),
                RequireInternetConnection  = requireInternetConnection
            },
                new RateBoxTextSettings()
            {
                Title               = title.Trim(),
                Message             = message.Trim(),
                RateButtonTitle     = rateButton.Trim(),
                PostponeButtonTitle = postponeButton.Trim(),
                RejectButtonTitle   = rejectButtonTrimmed.Length > 0 ? rejectButtonTrimmed.Trim() : null
            },
                new RateBoxSettings()
            {
                UseIOSReview = useIOSReview
            }
                );

            // Custom alertAdapter allows to display custom UI windows instead of native alerts
            IAlertPlatformAdapter alertAdapter = null;
            if (customUIWindow != null)
            {
                customUIWindow.SetActive(false);
                alertAdapter = customUIWindow.GetComponent <IAlertPlatformAdapter>();
            }

            RateBox.Instance.AlertAdapter = alertAdapter;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Call <see cref="PaperPlaneTools.RateBox.Init"/> function
        /// </summary>
        void Start()
        {
            string CurrentLanguage           = Lean.Localization.LeanLocalization.CurrentLanguage;
            string TitleString               = "";
            string MessageString             = "";
            string RateButtonTitleString     = "";
            string PostponeButtonTitleString = "";

            if (CurrentLanguage == "French")
            {
                TitleString               = "Tu apprécies le jeu?";
                MessageString             = "Prends un moment pour nous noter!";
                RateButtonTitleString     = "Noter";
                PostponeButtonTitleString = "Plus tard";
            }
            if (CurrentLanguage == "English")
            {
                TitleString               = "Do you like the game?";
                MessageString             = "Take a moment to rate us !";
                RateButtonTitleString     = "Rate";
                PostponeButtonTitleString = "Later";
            }
            if (CurrentLanguage == "German")
            {
                TitleString               = "Magst du das Spiel?";
                MessageString             = "Nimm einen Augenblick Zeit und bewerte uns!";
                RateButtonTitleString     = "Bewerten";
                PostponeButtonTitleString = "Später";
            }
            string rateUrl = RateBox.GetStoreUrl(appStoreAppId, playMarketAppBundleId);

            //Debug settings are only allowed inside development environment
                        #if (UNITY_EDITOR)
            if (clearOnStart)
            {
                RateBox.Instance.ClearStatistics();
            }
            RateBox.Instance.DebugMode = logDebugMessages;
                        #else
            RateBox.Instance.DebugMode = false;
                        #endif

            var rejectButtonTrimmed = rejectButton.Trim();
            RateBox.Instance.Init(
                rateUrl,
                new RateBoxConditions()
            {
                MinSessionCount            = minSessionCount,
                MinCustomEventsCount       = minCustomEventsCount,
                DelayAfterInstallInSeconds = Mathf.CeilToInt(delayAfterInstallInHours * 3600),
                DelayAfterLaunchInSeconds  = Mathf.CeilToInt(delayAfterLaunchInHours * 3600),
                PostponeCooldownInSeconds  = Mathf.CeilToInt(postponeCooldownInHours * 3600),
                RequireInternetConnection  = requireInternetConnection
            },
                new RateBoxTextSettings()
            {
                Title               = TitleString.Trim(),
                Message             = MessageString.Trim(),
                RateButtonTitle     = RateButtonTitleString.Trim(),
                PostponeButtonTitle = PostponeButtonTitleString.Trim(),
                RejectButtonTitle   = rejectButtonTrimmed.Length > 0 ? rejectButtonTrimmed.Trim() : null
            },
                new RateBoxSettings()
            {
                UseIOSReview = useIOSReview
            }
                );

            // Custom alertAdapter allows to display custom UI windows instead of native alerts
            IAlertPlatformAdapter alertAdapter = null;
            if (customUIWindow != null)
            {
                customUIWindow.SetActive(false);
                alertAdapter = customUIWindow.GetComponent <IAlertPlatformAdapter>();
            }

            RateBox.Instance.AlertAdapter = alertAdapter;
        }