C# Class UnityCommonLibrary.Time.UTimer

A timer that either operates in a standard timer or a stopwatch mode.
Show file Open project: thebeardphantom/UnityCommonLibrary Class Usage Examples

Public Properties

Property Type Description
allReadonly ReadOnlyCollection
duration float
timeMode TimeMode

Public Methods

Method Description
Pause ( ) : void

If currently running, pauses the timer.

Reset ( ) : void

Resets all readonly public and private timer counters.

Restart ( ) : void

Resets and starts the timer.

Resume ( ) : void

If currently paused, resumes the timer.

Start ( ) : void

If currently stopped, resets and then starts the timer.

Stop ( ) : void

If not currently stopped, stops the timer.

TickAll ( ) : void

This must be called by some external script for timers to update.

ToString ( ) : string
UTimer ( ) : System

Creates and Resets a new timer in Timer Mechanism in Time TimeMode.

UTimer ( Mechanism mechanism ) : System

Creates and Resets a new timer in Time TimeMode.

UTimer ( Mechanism mechanism, TimeMode timeMode ) : System

Creates and Resets a new timer.

UTimer ( TimeMode timeMode ) : System

Creates and Resets a new timer in Timer Mechanism.

Private Methods

Method Description
FireElapsedEvent ( ) : void
Tick ( ) : void

Updates the timer's counters and values.

Method Details

Pause() public method

If currently running, pauses the timer.
public Pause ( ) : void
return void

Reset() public method

Resets all readonly public and private timer counters.
public Reset ( ) : void
return void

Restart() public method

Resets and starts the timer.
public Restart ( ) : void
return void

Resume() public method

If currently paused, resumes the timer.
public Resume ( ) : void
return void

Start() public method

If currently stopped, resets and then starts the timer.
public Start ( ) : void
return void

Stop() public method

If not currently stopped, stops the timer.
public Stop ( ) : void
return void

TickAll() public static method

This must be called by some external script for timers to update.
public static TickAll ( ) : void
return void

ToString() public method

public ToString ( ) : string
return string

UTimer() public method

Creates and Resets a new timer in Timer Mechanism in Time TimeMode.
public UTimer ( ) : System
return System

UTimer() public method

Creates and Resets a new timer in Time TimeMode.
public UTimer ( Mechanism mechanism ) : System
mechanism Mechanism The directional mechanism to use.
return System

UTimer() public method

Creates and Resets a new timer.
public UTimer ( Mechanism mechanism, TimeMode timeMode ) : System
mechanism Mechanism The directional mechanism to use.
timeMode TimeMode The time counting mode to use.
return System

UTimer() public method

Creates and Resets a new timer in Timer Mechanism.
public UTimer ( TimeMode timeMode ) : System
timeMode TimeMode The time counting mode to use.
return System

Property Details

allReadonly public static property

A readonly wrapper for allTimers
public static ReadOnlyCollection allReadonly
return ReadOnlyCollection

duration public property

How long the timer takes to elapse in either direction.
public float duration
return float

timeMode public property

The method in which to determine time.
public TimeMode timeMode
return TimeMode