Esempio n. 1
0
    // SETTER --------------------------------------------------------

    public static void ConfigFirstRun()
    {
        if (!PlayerPrefs.HasKey(KEY_INTBOOL_IS_FIRST_RUN))
        {
            LogUtil.PrintWarning("PlayerPrefsUtil: First time run detected. Setting config defaults.");
            AnalyticsUtil.RecordFirstRun();

            PlayerPrefs.SetInt(KEY_INTBOOL_IS_FIRST_RUN, 1);

            //AUDIO
            PlayerPrefs.SetFloat(KEY_FLOAT_AUDIO_VOLUME_BGM, TheExplorersConfig.VOLUME_DEFAULT);
            PlayerPrefs.SetFloat(KEY_FLOAT_AUDIO_VOLUME_SFX, TheExplorersConfig.VOLUME_DEFAULT);

            //SCORES
            PlayerPrefs.SetString(KEY_STRING_HIGH_SCORE_1, "");
            PlayerPrefs.SetString(KEY_STRING_HIGH_SCORE_2, "");
            PlayerPrefs.SetString(KEY_STRING_HIGH_SCORE_3, "");
            PlayerPrefs.SetString(KEY_STRING_HIGH_SCORE_4, "");
            PlayerPrefs.SetString(KEY_STRING_HIGH_SCORE_5, "");

            PlayerPrefs.SetInt(KEY_INT_HIGHEST_LEVEL_CLEARED, 0);

            PlayerPrefs.Save();
        }
        else
        {
            LogUtil.PrintInfo("PlayerPrefsUtil: This isn't the 1st time the game is ran. Ignoring config defaults.");
        }
    }