Skip to content

GameCalendarKit.Ticker

TonyBaker edited this page May 2, 2017 · 1 revision

Ticker is the successor of MonoBehaviour and provides the necessary set of methods and events for make timer counting.

Can be used wthout GameCalendar and GameClock.

Namespace

Ticker contains in GameCalendarKit.TickerUtil namespace, don't forget to include it to your header if you use this class separately of GameClock or GameCalendar.

Events

  • TickEvent is a event method which will be launched when tick counted from private method OnTimedEvent().
  public event EventHandler<TickEventObject> TickEvent;

Methods

  • TickerInit is a initiated method which set a start values to ticker. Request two arguments:
    • ticks- How many ticks will be counted;
    • interval- The time interval between tick;
  public void TickerInit(int ticks, float interval)
  • StartNewTimer is a method to start new timer with initial values. Before start new, it will stop previous one if it already launched.
  public void StartNewTimer()
  • StartTimer is a method to continue timer from paused value.
  public void StartTimer()
  • StopTimer is a method to stop timer. Also will fireup Tick event whit current tick and iteration.
  public void StopTimer()
  • public void PauseTimer()
  public event EventHandler<GameClockEventObject> TimeChangedEvent;

Clone this wiki locally