forked from AntonyHatchet/GameCalendarKit
-
Notifications
You must be signed in to change notification settings - Fork 0
GameCalendarKit.GameClock
Gravideots edited this page May 2, 2017
·
2 revisions
GameClock is the successor of MonoBehaviour and provides the necessary set of methods and events for creating game time.
Can be used without GameCalendar to check time from start to end values.
GameClock contains in GameCalendarKit.Clock namespace, don't forget to include it to your header if you use this class separately of GameCalendar.
- TimeChangedEvent is a event method which will be launched when game time changed.
public event EventHandler<GameClockEventObject> TimeChangedEvent;- DayEndEvent is a event method which will be launched when game day ending.
public event EventHandler<GameClockEventObject> DayEndEvent;- GameClockInit is an initialization method which set a start values to ticker and add to event TickEvent, method ClockWork. Request three arguments:
- startTime - from this value it will start tick;
- endTime - when clock reach this value DayEndEvent will fired up;
- interval - this value tell how many seconds will be in one game minute.
public void GameClockInit(int startTime, int endTime, float interval)- StartClock is a method that start clock work.
public void StartClock()- PauseClock is a method for pause clock time. Stop only this clock time, Unity time is still work.
public void PauseClock()- ContinueClock is a method for continue clock time. Continue from paused value.
public void ContinueClock()