Feel  3.16
The best way to improve your game's feel and make it extra juicy
MoreMountains.Tools.MMCountdown Class Reference
Inheritance diagram for MoreMountains.Tools.MMCountdown:
MoreMountains.Tools.MMMonoBehaviour

Classes

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

Public Types

enum  MMCountdownDirections { MMCountdownDirections.Ascending, MMCountdownDirections.Descending }
 the possible directions for this countdown More...
 
enum  FormatMethods { FormatMethods.Explicit, FormatMethods.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...
 
virtual void ChangeDirection ()
 Changes the direction of the countdown from ascending to descending, or from descending to ascending More...
 
virtual void SetCurrentTime (float newCurrentTime)
 Sets the current time to the new specified value More...
 

Public Attributes

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...
 
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...
 
bool StopCountdownButton
 Debug button to stop the countdown. More...
 
bool StartCountdownButton
 Debug button to start the countdown. More...
 
bool ResetCountdownButton
 Debug button to reset the countdown. More...
 
bool ChangeDirectionButton
 Debug button to change the direction of the countdown. More...
 
float DebugNewCurrentTime = 5f
 A debug value to which to set the current time when pressing the DebugSetNewCurrentTime button. More...
 
bool DebugSetNewCurrentTimeButton
 Debug button to change the countdown's current time. More...
 

Protected Member Functions

virtual void Start ()
 On Start, grabs and stores the Text component, and autostarts if needed More...
 
virtual void Initialization ()
 On init, initializes the direction, handles auto start and floors More...
 
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

◆ ChangeDirection()

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

Changes the direction of the countdown from ascending to descending, or from descending to ascending

◆ 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

On init, initializes the direction, handles auto start and floors

◆ ResetCountdown()

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

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

◆ SetCurrentTime()

virtual void MoreMountains.Tools.MMCountdown.SetCurrentTime ( float  newCurrentTime)
virtual

Sets the current time to the new specified value

Parameters
newCurrentTime

◆ 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

◆ ChangeDirectionButton

bool MoreMountains.Tools.MMCountdown.ChangeDirectionButton

Debug button to change the direction of the countdown.

◆ 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

◆ DebugNewCurrentTime

float MoreMountains.Tools.MMCountdown.DebugNewCurrentTime = 5f

A debug value to which to set the current time when pressing the DebugSetNewCurrentTime button.

◆ DebugSetNewCurrentTimeButton

bool MoreMountains.Tools.MMCountdown.DebugSetNewCurrentTimeButton

Debug button to change the countdown's current time.

◆ 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

◆ ResetCountdownButton

bool MoreMountains.Tools.MMCountdown.ResetCountdownButton

Debug button to reset the countdown.

◆ Seconds

bool MoreMountains.Tools.MMCountdown.Seconds = true

◆ StartCountdownButton

bool MoreMountains.Tools.MMCountdown.StartCountdownButton

Debug button to start the countdown.

◆ StopCountdownButton

bool MoreMountains.Tools.MMCountdown.StopCountdownButton

Debug button to stop the countdown.


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