Helper Scripts Collection 1.3.1
API documentation for the helper scripts compatible with Unity3D
Public Types | Public Member Functions | Public Attributes | Protected Attributes | Properties | List of all members
NikosAssets.Helpers.TimingHelper Class Reference

A helper class to handle in-game (Application) time and overall DateTime as well More...

Public Types

enum  TimerType {
  Instant = 0 , Never = 1 , MilliSeconds = 3 , Seconds = 4 ,
  Minutes = 5 , Hours = 6 , Days = 7
}
 The available time frames to check
 

Public Member Functions

 TimingHelper (TimerType timerType)
 
 TimingHelper (TimerType timerType, Vector2 minMaxRandomTimeRange)
 
virtual void Init ()
 Call this before using the timer
 
virtual bool CheckRunningTime (float checkAgainst)
 Checks if the in-game time is reached using the checkAgainst time More...
 
virtual bool CheckRunningTime ()
 Checks if the in-game time is reached using the local CheckAgainstRunningTime More...
 
virtual bool CheckDateTime (DateTime checkAgainst)
 Checks if the DateTime is reached using the checkAgainst time More...
 
virtual bool CheckDateTime ()
 Checks if the DateTime is reached using the local CheckAgainstDateTime More...
 
virtual object Clone ()
 Fast cloning More...
 

Public Attributes

TimerType timerType = TimerType.Instant
 Which time frames do you want to check?
 
Vector2 minMaxRandomTimeRange = new Vector2(10, 10)
 Inclusive times to randomly generate
 

Protected Attributes

double _secondsMultiplier = 1
 Used in Time.Time.time checks
 
double _milliSecondsMultiplier = 1
 Used in DateTime checks
 

Properties

float CheckAgainstRunningTime [get, set]
 Update this value, whenever you want to reset the timer to a certain time
 
DateTime CheckAgainstDateTime = DateTime.Now [get, set]
 Update this value, whenever you want to reset the timer to a certain time
 
double SecondsMultiplier [get]
 Used in Time.Time.time checks
 
double MilliSecondsMultiplier [get]
 Used in DateTime checks
 

Detailed Description

A helper class to handle in-game (Application) time and overall DateTime as well

Member Function Documentation

◆ CheckDateTime() [1/2]

virtual bool NikosAssets.Helpers.TimingHelper.CheckDateTime ( )
virtual

Checks if the DateTime is reached using the local CheckAgainstDateTime

Returns
bool: false = inTime, true = time reached or exceeded

◆ CheckDateTime() [2/2]

virtual bool NikosAssets.Helpers.TimingHelper.CheckDateTime ( DateTime  checkAgainst)
virtual

Checks if the DateTime is reached using the checkAgainst time

Parameters
checkAgainst
Returns
bool: false = inTime, true = time reached or exceeded

◆ CheckRunningTime() [1/2]

virtual bool NikosAssets.Helpers.TimingHelper.CheckRunningTime ( )
virtual

Checks if the in-game time is reached using the local CheckAgainstRunningTime

Returns
bool: false = inTime, true = time reached or exceeded

◆ CheckRunningTime() [2/2]

virtual bool NikosAssets.Helpers.TimingHelper.CheckRunningTime ( float  checkAgainst)
virtual

Checks if the in-game time is reached using the checkAgainst time

Parameters
checkAgainst
Returns
bool: false = inTime, true = time reached or exceeded

◆ Clone()

virtual object NikosAssets.Helpers.TimingHelper.Clone ( )
virtual

Fast cloning

Returns
An independent clone of this object