public Tapestry_TimeIndex GetIndexFromOffset(int seconds, int minutes = 0, int hours = 0, int days = 0, int months = 0, int years = 0) { Tapestry_TimeIndex ti = new Tapestry_TimeIndex(Second, Minute, Hour, Date, Month, Year); int delta = seconds; delta += (int)(minutes * secondsPerMinute); delta += (int)(hours * minutesPerHour * secondsPerMinute); delta += (int)(days * hoursPerDay * minutesPerHour * secondsPerMinute); delta += (int)(months * daysPerMonth * hoursPerDay * minutesPerHour * secondsPerMinute); delta += (int)(years * monthsPerYear * daysPerMonth * hoursPerDay * minutesPerHour * secondsPerMinute); ti.AddTime(delta); return(ti); }
public static float EvaluateTime(float timeToAdd = 0f) { if (!IsPaused) { leftoverTime += timeToAdd; if (leftoverTime >= 1) { worldTime.AddTime(Mathf.FloorToInt(leftoverTime)); leftoverTime = leftoverTime % 1; } sunProg = worldTime.ProgressUntilNextDay(leftoverTime); } return sunProg; }