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)); } }
private List <Currency> LoadCurrencies() { GameConfig gameConfig = ConfigManager.Instance.Get <GameConfig>(); List <Currency> currencies = new List <Currency>(); currencies.Add(new Dollar(CustomPlayerPrefs.GetFloat(StringConstants.PlayerPrefsKeys.Dollar, gameConfig.StartDollars))); currencies.Add(new Respect(CustomPlayerPrefs.GetFloat(StringConstants.PlayerPrefsKeys.Respect, gameConfig.StartRespect))); return(currencies); }