Highroad Engine v1.3
Classes | Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
MoreMountains.Tools.MMCountdown Class Reference
Inheritance diagram for MoreMountains.Tools.MMCountdown:

Classes

class  MMCountdownFloor
 A class to store floor information More...
 

Public Types

enum  MMCountdownDirections { Ascending , Descending }
 the possible directions for this countdown More...
 
enum  FormatMethods { Explicit , Choices }
 

Public Member Functions

virtual void StartCountdown ()
 Starts (or restarts) the countdown More...
 
virtual void StopCountdown ()
 Stops the countdown from countdowning More...
 
virtual void ResetCountdown ()
 Resets the countdown, setting its current time to the one defined in the inspector More...
 

Public Attributes

float CurrentTime
 the time left in our countdown More...
 
MMCountdownDirections Direction
 the direction of the countdown (going 1, 2, 3 if Ascending, and 3, 2, 1 if Descending) More...
 
float CountdownFrom = 60f
 the time (in seconds) to count down from More...
 
float CountdownTo = 0f
 the time (in seconds) to count down to More...
 
bool Infinite = false
 if this is true, the countdown will have no end and will just keep counting in its direction More...
 
FormatMethods FormatMethod = FormatMethods.Choices
 the selected format method More...
 
bool FloorValues = true
 whether or not values should be floored before displaying them More...
 
string Format = "00.00"
 the format (standard Unity ToString) to use when displaying the time left in the text field More...
 
bool Hours = false
 
bool Minutes = true
 
bool Seconds = true
 
bool Milliseconds = false
 
bool AutoStart = true
 if this is true, the countdown will start as soon as this object Starts More...
 
bool AutoReset = false
 if this is true, the countdown will automatically go back to its initial value when it reaches its destination More...
 
bool PingPong = false
 if this is true, the countdown will pingpong in the other direction when end is met More...
 
float RefreshFrequency = 0.02f
 the frequency (in seconds) at which to refresh the text field More...
 
float CountdownSpeed = 1f
 the speed of the countdown (2 : twice the normal speed, 0.5 : twice slower) More...
 
List< MMCountdownFloorFloors
 a list of floors this countdown will evaluate and trigger if met More...
 
UnityEvent CountdownCompleteEvent
 an event to trigger when the countdown reaches its destination More...
 
UnityEvent CountdownRefreshEvent
 an event to trigger every time the countdown text gets refreshed More...
 

Protected Member Functions

virtual void Start ()
 On Start, grabs and stores the Text component, and autostarts if needed More...
 
virtual void Initialization ()
 
virtual void Update ()
 On Update, updates the Time, text, checks for floors and checks for the end of the countdown More...
 
virtual void UpdateTime ()
 Updates the CurrentTime value by substracting the delta time, factored by the defined speed More...
 
virtual void UpdateText ()
 Refreshes the text component at the specified refresh frequency More...
 
virtual void CheckForEnd ()
 Checks whether or not we've reached the end of the countdown More...
 
virtual void CheckForFloors ()
 Every frame, checks if we've reached one of the defined floors, and triggers the corresponding events if that's the case More...
 

Protected Attributes

Text _text
 
float _lastRefreshAt
 
bool _countdowning = false
 
int _lastUnitValue = 0
 

Member Enumeration Documentation

◆ FormatMethods

Enumerator
Explicit 
Choices 

◆ MMCountdownDirections

the possible directions for this countdown

Enumerator
Ascending 
Descending 

Member Function Documentation

◆ CheckForEnd()

virtual void MoreMountains.Tools.MMCountdown.CheckForEnd ( )
protectedvirtual

Checks whether or not we've reached the end of the countdown

◆ CheckForFloors()

virtual void MoreMountains.Tools.MMCountdown.CheckForFloors ( )
protectedvirtual

Every frame, checks if we've reached one of the defined floors, and triggers the corresponding events if that's the case

◆ Initialization()

virtual void MoreMountains.Tools.MMCountdown.Initialization ( )
protectedvirtual

◆ ResetCountdown()

virtual void MoreMountains.Tools.MMCountdown.ResetCountdown ( )
virtual

Resets the countdown, setting its current time to the one defined in the inspector

◆ Start()

virtual void MoreMountains.Tools.MMCountdown.Start ( )
protectedvirtual

On Start, grabs and stores the Text component, and autostarts if needed

◆ StartCountdown()

virtual void MoreMountains.Tools.MMCountdown.StartCountdown ( )
virtual

Starts (or restarts) the countdown

◆ StopCountdown()

virtual void MoreMountains.Tools.MMCountdown.StopCountdown ( )
virtual

Stops the countdown from countdowning

◆ Update()

virtual void MoreMountains.Tools.MMCountdown.Update ( )
protectedvirtual

On Update, updates the Time, text, checks for floors and checks for the end of the countdown

◆ UpdateText()

virtual void MoreMountains.Tools.MMCountdown.UpdateText ( )
protectedvirtual

Refreshes the text component at the specified refresh frequency

◆ UpdateTime()

virtual void MoreMountains.Tools.MMCountdown.UpdateTime ( )
protectedvirtual

Updates the CurrentTime value by substracting the delta time, factored by the defined speed

Member Data Documentation

◆ _countdowning

bool MoreMountains.Tools.MMCountdown._countdowning = false
protected

◆ _lastRefreshAt

float MoreMountains.Tools.MMCountdown._lastRefreshAt
protected

◆ _lastUnitValue

int MoreMountains.Tools.MMCountdown._lastUnitValue = 0
protected

◆ _text

Text MoreMountains.Tools.MMCountdown._text
protected

◆ AutoReset

bool MoreMountains.Tools.MMCountdown.AutoReset = false

if this is true, the countdown will automatically go back to its initial value when it reaches its destination

◆ AutoStart

bool MoreMountains.Tools.MMCountdown.AutoStart = true

if this is true, the countdown will start as soon as this object Starts

◆ CountdownCompleteEvent

UnityEvent MoreMountains.Tools.MMCountdown.CountdownCompleteEvent

an event to trigger when the countdown reaches its destination

◆ CountdownFrom

float MoreMountains.Tools.MMCountdown.CountdownFrom = 60f

the time (in seconds) to count down from

◆ CountdownRefreshEvent

UnityEvent MoreMountains.Tools.MMCountdown.CountdownRefreshEvent

an event to trigger every time the countdown text gets refreshed

◆ CountdownSpeed

float MoreMountains.Tools.MMCountdown.CountdownSpeed = 1f

the speed of the countdown (2 : twice the normal speed, 0.5 : twice slower)

◆ CountdownTo

float MoreMountains.Tools.MMCountdown.CountdownTo = 0f

the time (in seconds) to count down to

◆ CurrentTime

float MoreMountains.Tools.MMCountdown.CurrentTime

the time left in our countdown

◆ Direction

MMCountdownDirections MoreMountains.Tools.MMCountdown.Direction

the direction of the countdown (going 1, 2, 3 if Ascending, and 3, 2, 1 if Descending)

◆ Floors

List<MMCountdownFloor> MoreMountains.Tools.MMCountdown.Floors

a list of floors this countdown will evaluate and trigger if met

◆ FloorValues

bool MoreMountains.Tools.MMCountdown.FloorValues = true

whether or not values should be floored before displaying them

◆ Format

string MoreMountains.Tools.MMCountdown.Format = "00.00"

the format (standard Unity ToString) to use when displaying the time left in the text field

◆ FormatMethod

FormatMethods MoreMountains.Tools.MMCountdown.FormatMethod = FormatMethods.Choices

the selected format method

◆ Hours

bool MoreMountains.Tools.MMCountdown.Hours = false

◆ Infinite

bool MoreMountains.Tools.MMCountdown.Infinite = false

if this is true, the countdown will have no end and will just keep counting in its direction

◆ Milliseconds

bool MoreMountains.Tools.MMCountdown.Milliseconds = false

◆ Minutes

bool MoreMountains.Tools.MMCountdown.Minutes = true

◆ PingPong

bool MoreMountains.Tools.MMCountdown.PingPong = false

if this is true, the countdown will pingpong in the other direction when end is met

◆ RefreshFrequency

float MoreMountains.Tools.MMCountdown.RefreshFrequency = 0.02f

the frequency (in seconds) at which to refresh the text field

◆ Seconds

bool MoreMountains.Tools.MMCountdown.Seconds = true

The documentation for this class was generated from the following file: