Infinite Runner Engine v1.9
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
MoreMountains.Feedbacks.MMTimeManager Class Reference

Put this component in your scene and it'll catch MMFreezeFrameEvents and MMTimeScaleEvents, allowing you to control the flow of time. More...

Inheritance diagram for MoreMountains.Feedbacks.MMTimeManager:

Public Member Functions

virtual void Initialization ()
 
virtual void SetTimescaleTo (float newNormalTimeScale)
 Sets the time scale to the specified value, instantly More...
 
virtual void OnTimeScaleEvent (MMTimeScaleMethods timeScaleMethod, float timeScale, float duration, bool lerp, float lerpSpeed, bool infinite)
 Catches TimeScaleEvents and acts on them More...
 
virtual void OnMMFreezeFrameEvent (float duration)
 When getting a freeze frame event we stop the time More...
 

Public Attributes

float NormalTimescale = 1f
 The reference timescale, to which the system will go back to after all time is changed. More...
 
float DefaultLerpSpeed = 1f
 The reference timescale, to which the system will go back to after all time is changed. More...
 
bool DefaultLerpTimescale = false
 The reference timescale, to which the system will go back to after all time is changed. More...
 
float CurrentTimeScale = 1f
 the current, real time, time scale More...
 
float TargetTimeScale = 1f
 the time scale the system is lerping towards More...
 
bool LerpTimescale = true
 whether or not the timescale should be lerping More...
 
float LerpSpeed
 the speed at which the timescale should lerp towards its target More...
 
bool TestButton
 a test button for the inspector More...
 

Protected Member Functions

virtual void TestButtonToSlowDownTime ()
 A method used from the inspector to test the system More...
 
virtual void Start ()
 On start we initialize our stack and store our initial time scale More...
 
virtual void Update ()
 On Update, applies the timescale and resets it if needed More...
 
virtual void ApplyTimeScale (float newValue)
 Modifies the timescale and time attributes to match the new timescale More...
 
virtual void SetTimeScale (float newTimeScale)
 Resets all stacked timescale changes and simply sets the timescale, until further changes More...
 
virtual void SetTimeScale (TimeScaleProperties timeScaleProperties)
 Sets the time scale for the specified properties (duration, time scale, lerp or not, and lerp speed) More...
 
virtual void ResetTimeScale ()
 Resets the time scale to the stored normal timescale More...
 
virtual void Unfreeze ()
 Resets the time scale to the last saved time scale. More...
 

Protected Attributes

Stack< TimeScaleProperties_timeScaleProperties
 
float _frozenTimeLeft = -1f
 
TimeScaleProperties _currentProperty
 
float _initialFixedDeltaTime = 0f
 
float _initialMaximumDeltaTime = 0f
 

Detailed Description

Put this component in your scene and it'll catch MMFreezeFrameEvents and MMTimeScaleEvents, allowing you to control the flow of time.

Member Function Documentation

◆ ApplyTimeScale()

virtual void MoreMountains.Feedbacks.MMTimeManager.ApplyTimeScale ( float  newValue)
protectedvirtual

Modifies the timescale and time attributes to match the new timescale

Parameters
newValue

◆ Initialization()

virtual void MoreMountains.Feedbacks.MMTimeManager.Initialization ( )
virtual

◆ OnMMFreezeFrameEvent()

virtual void MoreMountains.Feedbacks.MMTimeManager.OnMMFreezeFrameEvent ( float  duration)
virtual

When getting a freeze frame event we stop the time

Parameters
freezeFrameEventFreeze frame event.

◆ OnTimeScaleEvent()

virtual void MoreMountains.Feedbacks.MMTimeManager.OnTimeScaleEvent ( MMTimeScaleMethods  timeScaleMethod,
float  timeScale,
float  duration,
bool  lerp,
float  lerpSpeed,
bool  infinite 
)
virtual

Catches TimeScaleEvents and acts on them

Parameters
timeScaleEventMMTimeScaleEvent event.

◆ ResetTimeScale()

virtual void MoreMountains.Feedbacks.MMTimeManager.ResetTimeScale ( )
protectedvirtual

Resets the time scale to the stored normal timescale

◆ SetTimeScale() [1/2]

virtual void MoreMountains.Feedbacks.MMTimeManager.SetTimeScale ( float  newTimeScale)
protectedvirtual

Resets all stacked timescale changes and simply sets the timescale, until further changes

Parameters
newTimeScaleNew time scale.

◆ SetTimeScale() [2/2]

virtual void MoreMountains.Feedbacks.MMTimeManager.SetTimeScale ( TimeScaleProperties  timeScaleProperties)
protectedvirtual

Sets the time scale for the specified properties (duration, time scale, lerp or not, and lerp speed)

Parameters
timeScalePropertiesTime scale properties.

◆ SetTimescaleTo()

virtual void MoreMountains.Feedbacks.MMTimeManager.SetTimescaleTo ( float  newNormalTimeScale)
virtual

Sets the time scale to the specified value, instantly

Parameters
newNormalTimeScaleNew normal time scale.

◆ Start()

virtual void MoreMountains.Feedbacks.MMTimeManager.Start ( )
protectedvirtual

On start we initialize our stack and store our initial time scale

◆ TestButtonToSlowDownTime()

virtual void MoreMountains.Feedbacks.MMTimeManager.TestButtonToSlowDownTime ( )
protectedvirtual

A method used from the inspector to test the system

◆ Unfreeze()

virtual void MoreMountains.Feedbacks.MMTimeManager.Unfreeze ( )
protectedvirtual

Resets the time scale to the last saved time scale.

◆ Update()

virtual void MoreMountains.Feedbacks.MMTimeManager.Update ( )
protectedvirtual

On Update, applies the timescale and resets it if needed

Member Data Documentation

◆ _currentProperty

TimeScaleProperties MoreMountains.Feedbacks.MMTimeManager._currentProperty
protected

◆ _frozenTimeLeft

float MoreMountains.Feedbacks.MMTimeManager._frozenTimeLeft = -1f
protected

◆ _initialFixedDeltaTime

float MoreMountains.Feedbacks.MMTimeManager._initialFixedDeltaTime = 0f
protected

◆ _initialMaximumDeltaTime

float MoreMountains.Feedbacks.MMTimeManager._initialMaximumDeltaTime = 0f
protected

◆ _timeScaleProperties

Stack<TimeScaleProperties> MoreMountains.Feedbacks.MMTimeManager._timeScaleProperties
protected

◆ CurrentTimeScale

float MoreMountains.Feedbacks.MMTimeManager.CurrentTimeScale = 1f

the current, real time, time scale

◆ DefaultLerpSpeed

float MoreMountains.Feedbacks.MMTimeManager.DefaultLerpSpeed = 1f

The reference timescale, to which the system will go back to after all time is changed.

◆ DefaultLerpTimescale

bool MoreMountains.Feedbacks.MMTimeManager.DefaultLerpTimescale = false

The reference timescale, to which the system will go back to after all time is changed.

◆ LerpSpeed

float MoreMountains.Feedbacks.MMTimeManager.LerpSpeed

the speed at which the timescale should lerp towards its target

◆ LerpTimescale

bool MoreMountains.Feedbacks.MMTimeManager.LerpTimescale = true

whether or not the timescale should be lerping

◆ NormalTimescale

float MoreMountains.Feedbacks.MMTimeManager.NormalTimescale = 1f

The reference timescale, to which the system will go back to after all time is changed.

◆ TargetTimeScale

float MoreMountains.Feedbacks.MMTimeManager.TargetTimeScale = 1f

the time scale the system is lerping towards

◆ TestButton

bool MoreMountains.Feedbacks.MMTimeManager.TestButton

a test button for the inspector


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