WorldClock/Scripts/TimeData.cs
/// <summary>
/// Moves this TimeData forward by the specified number of minutes
/// </summary>
/// <param name="minutesPerTick">The number of minutes to move forward</param>
Moves this TimeData forward by the specified number of minutes
Moves this TimeData forward by the specified number of minutes
public virtual void TickMinutes(int minutesPerTick)
    {
        if (minutesPerTick < 0)
            minutesPerTick = 0;
        if (minutesPerTick > MyGlobalTime.minutesInAnHour)
        {
            Debug.LogWarning("Cannot tick more than an hour at a time. Will only tick 1 hour.");
            minutesPerTick = MyGlobalTime.minutesInAnHour;
        }
        int newMinutes = minutes + minutesPerTick;
        if (newMinutes >= MyGlobalTime.minutesInAnHour)
        {
            minutes = newMinutes - MyGlobalTime.minutesInAnHour;
            AddAnHour();
        }
        else
            minutes += minutesPerTick;
        if (Tick != null)
            Tick();
    }
public virtual void TickMinutes ( int minutesPerTick ) { if ( minutesPerTick < 0 ) minutesPerTick = 0 ; if ( minutesPerTick > MyGlobalTime . minutesInAnHour ) { Debug . LogWarning ( " " ) ; minutesPerTick = MyGlobalTime . minutesInAnHour ; } int newMinutes = minutes + minutesPerTick ; if ( newMinutes >= MyGlobalTime . minutesInAnHour ) { minutes = newMinutes - MyGlobalTime . minutesInAnHour ; AddAnHour ( ) ; } else minutes += minutesPerTick ; if ( Tick != null ) Tick ( ) ; }
Moves this TimeData forward by the specified number of minutes
Moves this TimeData forward by the specified number of minutes
//Only moves forward //Ensure a portion of the hour has been added
minutesPerTick
int
The number of minutes to move forward
The number of minutes to move forward