Platformer Pro  2.3.2
A platform game kit for Unity.
PlatformerPro.TimeManagerWithTimer Class Reference

A TimeManager extension which kills all characters after a timer expires. More...

Inheritance diagram for PlatformerPro.TimeManagerWithTimer:
PlatformerPro.TimeManager PlatformerPro.PlatformerProMonoBehaviour

Public Member Functions

float AddTime (float extraTime)
 Adds the specified amount of time. You can also use a negative value to remove time. More...
 
- Public Member Functions inherited from PlatformerPro.TimeManager
virtual void OnGamePaused ()
 Raises the game paused event. More...
 
virtual void OnGameUnPaused ()
 Raises the game unpaused event. More...
 
void TogglePause (bool setTimeScale)
 Pause the game. More...
 
void Pause (bool setTimeScale, bool skipPauseMenu=false)
 Pause the game. More...
 
void UnPause (bool setTimeScale)
 Unpause the game. More...
 
void UnPause (float newTimeScale)
 Unpause the game. More...
 
- Public Member Functions inherited from PlatformerPro.PlatformerProMonoBehaviour
virtual void Validate (PlatformerProMonoBehaviour myTarget)
 Override this method if you want to provide custom validation. The actual code should be surrounded by the if UNITY_EDITOR / endif directive. More...
 

Protected Member Functions

void KillAllCharacters ()
 Kills all characters. More...
 
void ResetTimer ()
 Resets the timer. More...
 
void RegisterListeners ()
 Registers the listeners. More...
 
void DeregisterListeners ()
 Registers the listeners. More...
 
void HandleLoad (object sender, SceneEventArgs e)
 Handles the load event by resetting timer. More...
 
void HandleRespawn (object sender, CharacterEventArgs e)
 Handles the respawn event by resetting timer. More...
 

Protected Attributes

float timeLimit
 Time limit in seconds. More...
 
float maxTime
 Maximum time limit. More...
 
float timer
 The actual timer, when this reaches zero all characters will be killed. More...
 
bool killSent
 have we timed out and sent the kill message. More...
 
LevelManager levelManager
 Cached reference to level manager used for event listeners. More...
 
- Protected Attributes inherited from PlatformerPro.TimeManager
UIPauseMenu pauseMenu
 The pause menu. More...
 

Properties

override string Header [get]
 Gets the header string used to describe the component. More...
 
float CurrentTime [get]
 Gets the current timer value. More...
 
- Properties inherited from PlatformerPro.TimeManager
override string Header [get]
 Gets the header string used to describe the component. More...
 
static float FrameTime [get]
 Gets the frame time. More...
 
static float MaxFrameTime [get]
 Gets the maximum possible frame time. More...
 
static TimeManager Instance [get, protected set]
 Gets a static reference to the time manager if one exists. More...
 
static TimeManager SafeInstance [get]
 Gets the instance only if it exists will not create a new one. Safe to call from OnDestroy while unregistering listeners. More...
 
bool Paused [get]
 Are we paused? More...
 
- Properties inherited from PlatformerPro.PlatformerProMonoBehaviour
virtual string Header [get]
 Gets the header string used to describe the component. More...
 
virtual string DocLink [get]
 Gets a link to documentation site. More...
 
virtual string VideoLink [get]
 Gets a link to a youtube video. More...
 
virtual string Deprecated [get]
 If non-null this component is deprecated. The string shows a message indicating how it should be replaced. More...
 

Additional Inherited Members

- Public Attributes inherited from PlatformerPro.TimeManager
float maximumFrameTime = DefaultMaximumFrameTime
 The maximum permissable frame time. More...
 
- Static Public Attributes inherited from PlatformerPro.TimeManager
const float DefaultMaximumFrameTime = 0.033f
 The default maximum frame time. More...
 
- Static Protected Member Functions inherited from PlatformerPro.TimeManager
static void CreateNewTimeManager ()
 Creates a new time manager. More...
 
- Static Protected Attributes inherited from PlatformerPro.TimeManager
static bool paused
 Are we paused? More...
 
static TimeManager instance
 The time manager instance. More...
 
- Events inherited from PlatformerPro.TimeManager
System.EventHandler< EmptyEventArgsGamePaused
 Event for pause. More...
 
System.EventHandler< System.EventArgs > GameUnPaused
 Event for unpause. More...
 

Detailed Description

A TimeManager extension which kills all characters after a timer expires.

Member Function Documentation

◆ AddTime()

float PlatformerPro.TimeManagerWithTimer.AddTime ( float  extraTime)

Adds the specified amount of time. You can also use a negative value to remove time.

Returns
The time.
Parameters
extraTimeExtra time.

◆ DeregisterListeners()

void PlatformerPro.TimeManagerWithTimer.DeregisterListeners ( )
protected

Registers the listeners.

◆ HandleLoad()

void PlatformerPro.TimeManagerWithTimer.HandleLoad ( object  sender,
SceneEventArgs  e 
)
protected

Handles the load event by resetting timer.

Parameters
senderSender.
eEvent args.

◆ HandleRespawn()

void PlatformerPro.TimeManagerWithTimer.HandleRespawn ( object  sender,
CharacterEventArgs  e 
)
protected

Handles the respawn event by resetting timer.

Parameters
senderSender.
eEvent args.

◆ KillAllCharacters()

void PlatformerPro.TimeManagerWithTimer.KillAllCharacters ( )
protected

Kills all characters.

◆ RegisterListeners()

void PlatformerPro.TimeManagerWithTimer.RegisterListeners ( )
protected

Registers the listeners.

◆ ResetTimer()

void PlatformerPro.TimeManagerWithTimer.ResetTimer ( )
protected

Resets the timer.

Member Data Documentation

◆ killSent

bool PlatformerPro.TimeManagerWithTimer.killSent
protected

have we timed out and sent the kill message.

◆ levelManager

LevelManager PlatformerPro.TimeManagerWithTimer.levelManager
protected

Cached reference to level manager used for event listeners.

◆ maxTime

float PlatformerPro.TimeManagerWithTimer.maxTime
protected

Maximum time limit.

◆ timeLimit

float PlatformerPro.TimeManagerWithTimer.timeLimit
protected

Time limit in seconds.

◆ timer

float PlatformerPro.TimeManagerWithTimer.timer
protected

The actual timer, when this reaches zero all characters will be killed.

Property Documentation

◆ CurrentTime

float PlatformerPro.TimeManagerWithTimer.CurrentTime
get

Gets the current timer value.

◆ Header

override string PlatformerPro.TimeManagerWithTimer.Header
get

Gets the header string used to describe the component.

The header.


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