public void DeleteKey(SaveDataType type) { switch (type) { case SaveDataType.Round: ObscuredPrefs.DeleteKey(roundSaveName); break; case SaveDataType.Sound: ObscuredPrefs.DeleteKey(soundSaveName); break; case SaveDataType.UploadScrore: ObscuredPrefs.DeleteKey(uploadScoreSaveName); break; } }
private void DeleteObscuredPrefs() { ObscuredPrefs.DeleteKey(PREFS_INT); ObscuredPrefs.DeleteKey(PREFS_FLOAT); ObscuredPrefs.DeleteKey(PREFS_STRING); ObscuredPrefs.DeleteKey(PREFS_BOOL); ObscuredPrefs.DeleteKey(PREFS_UINT); ObscuredPrefs.DeleteKey(PREFS_LONG); ObscuredPrefs.DeleteKey(PREFS_DOUBLE); ObscuredPrefs.DeleteKey(PREFS_VECTOR2); ObscuredPrefs.DeleteKey(PREFS_VECTOR3); ObscuredPrefs.DeleteKey(PREFS_QUATERNION); ObscuredPrefs.DeleteKey(PREFS_RECT); ObscuredPrefs.DeleteKey(PREFS_COLOR); ObscuredPrefs.DeleteKey(PREFS_BYTE_ARRAY); ObscuredPrefs.Save(); }
internal void DeleteObscuredPrefs() { ObscuredPrefs.DeleteKey(PrefsInt); ObscuredPrefs.DeleteKey(PrefsFloat); ObscuredPrefs.DeleteKey(PrefsString); ObscuredPrefs.DeleteKey(PrefsBool); ObscuredPrefs.DeleteKey(PrefsUint); ObscuredPrefs.DeleteKey(PrefsLong); ObscuredPrefs.DeleteKey(PrefsDouble); ObscuredPrefs.DeleteKey(PrefsVector2); ObscuredPrefs.DeleteKey(PrefsVector3); ObscuredPrefs.DeleteKey(PrefsQuaternion); ObscuredPrefs.DeleteKey(PrefsRect); ObscuredPrefs.DeleteKey(PrefsColor); ObscuredPrefs.DeleteKey(PrefsByteArray); ObscuredPrefs.Save(); }
private void OnApplicationQuit() { PlayerPrefs.DeleteKey(PREFS_NAME); PlayerPrefs.DeleteKey(PREFS_MONEY); PlayerPrefs.DeleteKey(PREFS_LIFE_BAR); ObscuredPrefs.DeleteKey(PREFS_NAME); ObscuredPrefs.DeleteKey(PREFS_MONEY); ObscuredPrefs.DeleteKey(PREFS_LIFE_BAR); ObscuredPrefs.DeleteKey(PREFS_GAME_COMPLETE); ObscuredPrefs.DeleteKey(PREFS_UINT); ObscuredPrefs.DeleteKey(PREFS_LONG); ObscuredPrefs.DeleteKey(PREFS_DOUBLE); ObscuredPrefs.DeleteKey(PREFS_VECTOR3); ObscuredPrefs.DeleteKey(PREFS_RECT); ObscuredPrefs.DeleteKey(PREFS_BYTE_ARRAY); }
private void DeleteObscuredPrefs() { ObscuredPrefs.DeleteKey("money"); ObscuredPrefs.DeleteKey("lifeBar"); ObscuredPrefs.DeleteKey("name"); ObscuredPrefs.DeleteKey("gameComplete"); ObscuredPrefs.DeleteKey("demoUint"); ObscuredPrefs.DeleteKey("demoLong"); ObscuredPrefs.DeleteKey("demoDouble"); ObscuredPrefs.DeleteKey("demoVector2"); ObscuredPrefs.DeleteKey("demoVector3"); ObscuredPrefs.DeleteKey("demoQuaternion"); ObscuredPrefs.DeleteKey("demoRect"); ObscuredPrefs.DeleteKey("demoColor"); ObscuredPrefs.DeleteKey("demoByteArray"); ObscuredPrefs.Save(); }
private void TestPrefs() { this.logBuilder.AppendLine("ObscuredPrefs vs PlayerPrefs, " + this.prefsIterations + " iterations for read and write"); Stopwatch stopwatch = Stopwatch.StartNew(); for (int i = 0; i < this.prefsIterations; i++) { ObscuredPrefs.SetInt("__a", 1); ObscuredPrefs.SetFloat("__b", 2f); ObscuredPrefs.SetString("__c", "3"); } for (int j = 0; j < this.prefsIterations; j++) { ObscuredPrefs.GetInt("__a", 1); ObscuredPrefs.GetFloat("__b", 2f); ObscuredPrefs.GetString("__c", "3"); } stopwatch.Stop(); this.logBuilder.AppendLine("ObscuredPrefs:").AppendLine(stopwatch.ElapsedMilliseconds + " ms"); ObscuredPrefs.DeleteKey("__a"); ObscuredPrefs.DeleteKey("__b"); ObscuredPrefs.DeleteKey("__c"); stopwatch.Reset(); stopwatch.Start(); for (int k = 0; k < this.prefsIterations; k++) { PlayerPrefs.SetInt("__a", 1); PlayerPrefs.SetFloat("__b", 2f); PlayerPrefs.SetString("__c", "3"); } for (int l = 0; l < this.prefsIterations; l++) { PlayerPrefs.GetInt("__a", 1); PlayerPrefs.GetFloat("__b", 2f); PlayerPrefs.GetString("__c", "3"); } stopwatch.Stop(); this.logBuilder.AppendLine("PlayerPrefs:").AppendLine(stopwatch.ElapsedMilliseconds + " ms"); PlayerPrefs.DeleteKey("__a"); PlayerPrefs.DeleteKey("__b"); PlayerPrefs.DeleteKey("__c"); }
static IEnumerator ApplyFreeHeroCoolTime(float coolTime = constFreeHeroCoolTime) { //남은 시간 갱신 freeHeroRemainTime = coolTime; if (freeHeroRemainTime > 0f) { Instance.objFreeHero.SetActive(false); } float boostCool = coolTime + Time.unscaledTime; while (freeHeroRemainTime > 0f) { freeHeroRemainTime = boostCool - Time.unscaledTime; yield return(null); } ObscuredPrefs.DeleteKey("FreeHeroStartTime"); ObscuredPrefs.DeleteKey("FreeHeroRemainTime"); ObscuredPrefs.Save(); freeHeroStartTime = DateTime.MinValue; freeHeroRemainTime = 0f; if (onGetFreeHero != null) { onGetFreeHero(); } Instance.objFreeHero.SetActive(true); yield break; }
static IEnumerator ApplyFreeBoostCoolTime(float coolTime = constFreeBoostCoolTime) { //남은 시간 갱신 freeBoostRemainTime = coolTime; if (freeBoostRemainTime > 0f) { Instance.objBoostSpeed.SetActive(false); } float coolTimeRemain = coolTime + Time.unscaledTime; while (freeBoostRemainTime > 0f) { //freeBoostRemainTime -= Time.unscaledDeltaTime; freeBoostRemainTime = coolTimeRemain - Time.unscaledTime; yield return(null); } ObscuredPrefs.DeleteKey("FreeBoostStartTime"); ObscuredPrefs.DeleteKey("FreeBoostRemainTime"); ObscuredPrefs.Save(); if (onGetFreeBoost != null) { onGetFreeBoost(); } freeBoostStartTime = DateTime.MinValue; freeBoostRemainTime = 0f; Instance.objBoostSpeed.SetActive(true); yield break; }
public void DeleteKey(string _key) { ObscuredPrefs.DeleteKey(_key); }
public void clean() { cache = null; ObscuredPrefs.DeleteKey(KEY_LOGIN_SESSION); }
static IEnumerator ApplyBoostCoolTime(float coolTime = constBoostDoubleSpeedCoolTime) { //남은 시간 갱신 boostRemainTime = coolTime; float startTime = Time.unscaledTime; float lastSaveTime = Time.unscaledTime + 60f; float boostTime = coolTime + Time.unscaledTime; while (boostRemainTime > 0f) { boostRemainTime = boostTime - Time.unscaledTime; yield return(null); //5분 간격으로 부스트 남은 시간 저장 if (Time.unscaledTime > lastSaveTime) { lastSaveTime = lastSaveTime + 60f; ObscuredPrefs.SetFloat("boostSpeed", boostSpeed); if (boostSpeed >= 3f) { ObscuredPrefs.SetFloat("boostRemainTime", boostRemainTime); } ObscuredPrefs.Save(); } } ObscuredPrefs.DeleteKey("boostStartTime"); ObscuredPrefs.DeleteKey("boostSpeed"); ObscuredPrefs.DeleteKey("boostRemainTime"); ObscuredPrefs.Save(); boostStartTime = DateTime.MinValue; boostRemainTime = 0f; boostSpeed = 1f; if (ObscuredPrefs.HasKey("afterBoostSpeed")) { boostSpeed = ObscuredPrefs.GetFloat("afterBoostSpeed"); boostStartTime = DateTime.Now; boostRemainTime = ObscuredPrefs.GetFloat("afterBoostRemainTime"); ObscuredPrefs.DeleteKey("afterBoostSpeed"); ObscuredPrefs.DeleteKey("afterBoostRemainTime"); ObscuredPrefs.SetFloat("boostSpeed", boostSpeed); ObscuredPrefs.SetString("boostStartTime", boostStartTime.ToString()); ObscuredPrefs.SetFloat("boostRemainTime", boostRemainTime); ObscuredPrefs.Save(); coroutineBoostCoolTime = Instance.StartCoroutine(ApplyBoostCoolTime(boostRemainTime)); if (UIBoostTimer.Instance) { UIBoostTimer.Instance.StartBoostTimer(); } yield break; } else { coroutineBoostCoolTime = null; yield break; } }
public static void DeleteProgress() { PlayerPrefs.DeleteKey(WorldConsts.Save0); ObscuredPrefs.DeleteKey(WorldConsts.Save0); }
static public void RemoveAccountInfo() { ObscuredPrefs.DeleteKey(AccountIdxKey); ObscuredPrefs.DeleteKey(LoginTokenKey); ObscuredPrefs.DeleteKey(LoginPlatformKey); }