public void NextDay() { //remove the flag from the current day currentDay.IsCurrent = false; int nextDayIndex = GameDaysCurrentMonth.IndexOf(currentDay); if (nextDayIndex + 1 >= GameDaysCurrentMonth.Count) { //end of month reached DateController.instance.SetNextMonth(); return; } CurrentDay = GameDaysCurrentMonth[nextDayIndex + 1]; currentDay.IsCurrent = true; PrepareNextDay(); }
void PrepareNextMonth() { List <DateTime> newDays = DateController.instance.CurrentMonthDays; List <AFM_GameDay> tempList = new List <AFM_GameDay>(); foreach (DateTime day in newDays) { tempList.Add(new AFM_GameDay(day)); } GameDaysCurrentMonth = tempList; //set the first day of the month as current day CurrentDay = GameDaysCurrentMonth[0]; currentDay.IsCurrent = true; //here you might set the events for the next month SetGameEvents(); }