コード例 #1
0
    public override bool ConditionTest()
    {
        WorldDate currentDate     = TimeManagerScript.GetDate();
        bool      finishIsNextDay =
            (HoursOnly)? Start.ToSecondsHoursOnly() > Finish.ToSecondsHoursOnly() : false;
        bool currentIsNextDay = finishIsNextDay && Finish.ToSecondsHoursOnly() >= currentDate.ToSecondsHoursOnly();


        return
            ((HoursOnly) ?
             CompareHoursOnly(currentDate, currentIsNextDay, finishIsNextDay) :
             CompareFullDates(currentDate));
    }
コード例 #2
0
 private bool CompareHoursOnly(WorldDate currentDate, bool currentIsNextDay, bool finishIsNextDay)
 {
     return
         (Start.ToSecondsHoursOnly() <= currentDate.ToSecondsHoursOnly(currentIsNextDay) &&
          Finish.ToSecondsHoursOnly(finishIsNextDay) >= currentDate.ToSecondsHoursOnly());
 }