예제 #1
0
 public void FastForward(int FFDay,float FFTime)
 {
     int test = 0;
     if(FFDay >= currentDayReference){
         if(FFDay > currentDayReference){
             while(currentDayReference < FFDay && test<100){
                 FastForwardCurrentDay(24f);
                 currentDay=days[++currentDayReference];
                 currentDay.LoadDay();
                 time = 0;
                 nextEvent = currentDay.NextEvent(0);
                 ResetScheduleHeap(0);
                 test++;
             }
             FastForwardCurrentDay(FFTime);
             TimeToUnits(FFTime);
             time = FFTime;
         } else if (FFTime > time){
             FastForwardCurrentDay(FFTime);
             TimeToUnits(FFTime);
             time = FFTime;
         }
     }
 }
예제 #2
0
 void UpdateTime()
 {
     inGameSeconds += Time.deltaTime * (1440f / realMinutesPerDay);
     if(inGameSeconds>=60){
         inGameMinutes += Mathf.FloorToInt(inGameSeconds/60);
         inGameSeconds %= 60;
         if(inGameMinutes >= 60){
             inGameHours += Mathf.FloorToInt(inGameMinutes/60);
             inGameMinutes %= 60;
             if(inGameHours >= 24){
                 inGameHours = inGameHours % 24;
                 currentDay=days[++currentDayReference];
                 currentDay.LoadDay();
                 nextEvent = currentDay.NextEvent(0);
                 foreach(KeyValuePair<string,Person> person in Population.master.peopleDictionary){
                     if(person.Value.schedule!=null) person.Value.schedule.NextSchedule(0);
                 }
             }
         }
     }
     time = (float)inGameHours + (float)inGameMinutes / 60f;
 }