예제 #1
0
    void loadPrefs()
    {
        if (CustomPlayerPrefs.HasKey("selectedMaskID"))
        {
            selectedMaskID = CustomPlayerPrefs.GetInt("selectedMaskID");
            Debug.Log("prefered selectedMaskID detected");
        }
        if (CustomPlayerPrefs.HasKey("isMaskFlipped"))
        {
            isFlipped = CustomPlayerPrefs.GetBool("isMaskFlipped");
            Debug.Log("prefered isMaskFlipped detected");
        }
        if (CustomPlayerPrefs.HasKey("maskScale"))
        {
            maskScale = CustomPlayerPrefs.GetFloat("maskScale");
            Debug.Log("prefered maskScale detected");
        }
        else
        {
            maskScale = 11.2f;
        }
        if (CustomPlayerPrefs.HasKey("maskColor_R"))
        {
            float red   = CustomPlayerPrefs.GetFloat("maskColor_R");
            float green = CustomPlayerPrefs.GetFloat("maskColor_G");
            float blue  = CustomPlayerPrefs.GetFloat("maskColor_B");

            maskMat.SetColor("_Color", new Color(red, green, blue, maskMat.GetColor("_Color").a));
        }
        if (CustomPlayerPrefs.HasKey("maskAlpha"))
        {
            float alpha = CustomPlayerPrefs.GetFloat("maskAlpha");
            maskMat.SetColor("_Color", new Color(maskMat.GetColor("_Color").r, maskMat.GetColor("_Color").g, maskMat.GetColor("_Color").b, alpha));
        }
    }
예제 #2
0
        private IGameOptions LoadGameOptions()
        {
            IGameOptions gameOptions = new GameOptions();

            gameOptions.IsSoundOn = CustomPlayerPrefs.GetBool(StringConstants.PlayerPrefsKeys.IsSoundOn, true);
            gameOptions.IsMusicOn = CustomPlayerPrefs.GetBool(StringConstants.PlayerPrefsKeys.IsMusicOn, true);

            return(gameOptions);
        }
예제 #3
0
        private IUserStats LoadUserStats()
        {
            IUserStats inventory = new UserStats();

            inventory.IsFirstSession = CustomPlayerPrefs.GetBool(StringConstants.PlayerPrefsKeys.FirstSession, true);
            inventory.TutorialStage  = CustomPlayerPrefs.GetInt(StringConstants.PlayerPrefsKeys.TutorialStage, 0);

            return(inventory);
        }