Example #1
0
    private void ShowRateUsDialog()
    {
        // Don't show it again if it's already shown
        if (this.shownRateUsDialog)
        {
            return;
        }

        this.levelsCompleted++;

        // Only show it after complete a certain number of levels
        if (this.levelsCompleted >= this.LevelsCompleteBeforeShowingRateUs)
        {
            SetRateOptionOnClick.RateOptions rateOption = (SetRateOptionOnClick.RateOptions)PlayerPrefsFast.GetInt(this.RateOptionKey, 0);

            // Only show it if it's not been rated yet
            switch (rateOption)
            {
            case SetRateOptionOnClick.RateOptions.NotRated:
                this.RateUsDialog.SetActive(true);
                break;

            case SetRateOptionOnClick.RateOptions.Rated:
            case SetRateOptionOnClick.RateOptions.DoNotShowAgain:
                break;
            }

            // Set the flag so it doesn't try to show the Rate Us dialog again
            this.shownRateUsDialog = true;
        }
    }
Example #2
0
    private void Start()
    {
        SetRateOptionOnClick.RateOptions rateOption = (SetRateOptionOnClick.RateOptions)PlayerPrefsFast.GetInt(this.RateOptionKey, 0);

        // Only show it if it's not been rated yet
        switch (rateOption)
        {
        case SetRateOptionOnClick.RateOptions.NotRated:
            this.gameObject.SetActive(true);
            break;

        case SetRateOptionOnClick.RateOptions.Rated:
        case SetRateOptionOnClick.RateOptions.DoNotShowAgain:
            this.gameObject.SetActive(false);
            break;
        }
    }