C# Class RedBlueGames.Tools.RBTimer

ファイルを表示 Open project: redbluegames/rb-unity-tools

Public Methods

Method Description
GetTimeRemaining ( ) : float

Gets the time remaining.

IsUnset ( ) : bool

Determines whether this instance is unset.

RBTimer ( ) : System.Collections

Initializes a new instance of the RBTimer class without a Duration

RBTimer ( float timerDuration, bool repeats = false ) : System.Collections

Initializes a new instance of the RBTimer class with a duration.

Start ( MonoBehaviour targetMonobehaviour, System timerFinishedAction = null ) : void

Start the timer, attached to the specified targetMonobehaviour. Raises timerFinishedAction when complete.

Stop ( ) : void

Stop this timer, without calling the Finished action.

Private Methods

Method Description
CountdownForDuration ( float desiredDuration ) : IEnumerator
DoStart ( ) : void
StartTimerCoroutine ( float waitSeconds ) : void
StopTimerCoroutine ( ) : void
TimerFinished ( ) : void

Method Details

GetTimeRemaining() public method

Gets the time remaining.
public GetTimeRemaining ( ) : float
return float

IsUnset() public method

Determines whether this instance is unset.
public IsUnset ( ) : bool
return bool

RBTimer() public method

Initializes a new instance of the RBTimer class without a Duration
public RBTimer ( ) : System.Collections
return System.Collections

RBTimer() public method

Initializes a new instance of the RBTimer class with a duration.
public RBTimer ( float timerDuration, bool repeats = false ) : System.Collections
timerDuration float Timer duration.
repeats bool If set to true, timer will repeat after it completes.
return System.Collections

Start() public method

Start the timer, attached to the specified targetMonobehaviour. Raises timerFinishedAction when complete.
public Start ( MonoBehaviour targetMonobehaviour, System timerFinishedAction = null ) : void
targetMonobehaviour UnityEngine.MonoBehaviour Target monobehaviour to attach Coroutine to.
timerFinishedAction System Action invoked on timer complete.
return void

Stop() public method

Stop this timer, without calling the Finished action.
public Stop ( ) : void
return void