public static void LoadResource(DailyPanel dailyPanel) { // TO DO somethin.... dailyPanel.Clear(); string[] s = PlayerPrefsX.GetStringArray(KeySave.DAILY_REWARD); for (int i = 0; i < s.Length && i < dailyPanel.slots.Length; i++) { DailySlot slot = dailyPanel.slots[i]; string[] temp = s[i].Split(','); for (int j = 0; j < temp.Length; j++) { slot.ID = int.Parse(temp[j]); slot.IsOpen = Boolean.Parse(temp[++j]); slot.IsRecieve = Boolean.Parse(temp[++j]); } } }
public void RecieveReward(DailySlot slot) { if (slot.ID <= IndexReward && !slot.IsRecieve && slot.IsOpen) { slot.IsRecieve = true; if (IndexReward == (dailyPanel.slots.Length - 1)) { if (dailyPanel.IsRecieveAll()) { IndexReward = -1; dailyPanel.Clear(); dailyReward._checktime(); } } dailyPanel.SaveData(); } else { } }