protected override void Start() { base.Start(); int totalLoginDays = MyPlayerPrefs.LoadInt(SaveKeyName.TotalLoginDays, 0); if (totalLoginDays <= 0) { totalLoginDays = 1; } int weeklyCount = (totalLoginDays / elements.Length); int currentElementIndex = (totalLoginDays - 1) % elements.Length; for (int i = 0; i < elements.Length; i++) { int day = (weeklyCount * elements.Length) + i + 1; IGameItem item = LoginBonus.Instance.GetBonusItem(day); elements[i].Init(i + 1, item.Type, item.ID, item.Count, i <= currentElementIndex); //色変更 if (i < currentElementIndex) { elements[i].Color = alreadyGetElementColor; } else if (i == currentElementIndex) { elements[i].Color = currentDayColor; } else if (i > currentElementIndex) { elements[i].Color = willGetElementColor; } } }
public override void SetValue(float value) { if (GetValue() == value) { return; } OnValueChanged.Invoke(value); MyPlayerPrefs.SaveFloat(key, value); }
public override void SetValue(string value) { if (GetValue() == value) { return; } OnValueChanged.Invoke(value); MyPlayerPrefs.SaveString(key, value); }
public override void SetValue(long value) { if (GetValue() == value) { return; } this.value = value; OnValueChanged.Invoke(value); MyPlayerPrefs.SaveString(key, value.ToString()); }
protected override long LoadValue(long defaultValue) { long result; if (!long.TryParse(MyPlayerPrefs.LoadString(key, defaultValue.ToString()), out result)) { return(0); } return(result); }
public override void SetValue(int value) { if (GetValue() == value) { return; } this.value = value; OnValueChanged.Invoke(value); MyPlayerPrefs.SaveInt(key, value); }
protected override float LoadValue(float defaultValue) { return(MyPlayerPrefs.LoadFloat(key, defaultValue)); }
protected override int LoadValue(int defaultValue) { return(MyPlayerPrefs.LoadInt(key, defaultValue)); }
protected override bool LoadValue(bool defaultValue) { return(MyPlayerPrefs.LoadBool(key, defaultValue)); }
protected override string LoadValue(string defaultValue) { return(MyPlayerPrefs.LoadString(key, defaultValue)); }
public static void DeleteLevelData() { MyPlayerPrefs.Delete("CurrentLevel"); }
public static void DeleteAll() { MyPlayerPrefs.DeleteAll(); }
public void SaveValue(long value) { this.value = value; MyPlayerPrefs.SaveString(key, value.ToString()); }