Feel  3.16
The best way to improve your game's feel and make it extra juicy
MoreMountains.Tools.MMPeriodicExecution Class Reference

This class will let you trigger a OnRandomInterval event periodically, at random intervals More...

Inheritance diagram for MoreMountains.Tools.MMPeriodicExecution:

Public Attributes

Vector2 RandomIntervalDuration = new Vector2(1f, 3f)
 the min and max duration of the interval between two events, in seconds More...
 
UnityEvent OnRandomInterval
 the event to play at the end of each interval More...
 

Protected Member Functions

virtual void Start ()
 On Start we initialize our interval duration More...
 
virtual void Update ()
 On Update we check if we've reached the end of an interval More...
 
virtual void DetermineNewInterval ()
 Randomizes a new duration More...
 

Protected Attributes

float _lastUpdateAt = 0f
 
float _currentInterval = 0f
 

Detailed Description

This class will let you trigger a OnRandomInterval event periodically, at random intervals

Member Function Documentation

◆ DetermineNewInterval()

virtual void MoreMountains.Tools.MMPeriodicExecution.DetermineNewInterval ( )
protectedvirtual

Randomizes a new duration

◆ Start()

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

On Start we initialize our interval duration

◆ Update()

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

On Update we check if we've reached the end of an interval

Member Data Documentation

◆ _currentInterval

float MoreMountains.Tools.MMPeriodicExecution._currentInterval = 0f
protected

◆ _lastUpdateAt

float MoreMountains.Tools.MMPeriodicExecution._lastUpdateAt = 0f
protected

◆ OnRandomInterval

UnityEvent MoreMountains.Tools.MMPeriodicExecution.OnRandomInterval

the event to play at the end of each interval

◆ RandomIntervalDuration

Vector2 MoreMountains.Tools.MMPeriodicExecution.RandomIntervalDuration = new Vector2(1f, 3f)

the min and max duration of the interval between two events, in seconds


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