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)); }
private bool CompareHoursOnly(WorldDate currentDate, bool currentIsNextDay, bool finishIsNextDay) { return (Start.ToSecondsHoursOnly() <= currentDate.ToSecondsHoursOnly(currentIsNextDay) && Finish.ToSecondsHoursOnly(finishIsNextDay) >= currentDate.ToSecondsHoursOnly()); }