示例#1
0
        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);
        }
示例#4
0
        public override void SetValue(long value)
        {
            if (GetValue() == value)
            {
                return;
            }

            this.value = value;
            OnValueChanged.Invoke(value);
            MyPlayerPrefs.SaveString(key, value.ToString());
        }
示例#5
0
        protected override long LoadValue(long defaultValue)
        {
            long result;

            if (!long.TryParse(MyPlayerPrefs.LoadString(key, defaultValue.ToString()), out result))
            {
                return(0);
            }

            return(result);
        }
示例#6
0
        public override void SetValue(int value)
        {
            if (GetValue() == value)
            {
                return;
            }

            this.value = value;
            OnValueChanged.Invoke(value);
            MyPlayerPrefs.SaveInt(key, value);
        }
示例#7
0
 protected override float LoadValue(float defaultValue)
 {
     return(MyPlayerPrefs.LoadFloat(key, defaultValue));
 }
示例#8
0
 protected override int LoadValue(int defaultValue)
 {
     return(MyPlayerPrefs.LoadInt(key, defaultValue));
 }
示例#9
0
 protected override bool LoadValue(bool defaultValue)
 {
     return(MyPlayerPrefs.LoadBool(key, defaultValue));
 }
示例#10
0
 protected override string LoadValue(string defaultValue)
 {
     return(MyPlayerPrefs.LoadString(key, defaultValue));
 }
示例#11
0
 public static void DeleteLevelData()
 {
     MyPlayerPrefs.Delete("CurrentLevel");
 }
示例#12
0
 public static void DeleteAll()
 {
     MyPlayerPrefs.DeleteAll();
 }
 public void SaveValue(long value)
 {
     this.value = value;
     MyPlayerPrefs.SaveString(key, value.ToString());
 }