JUtils
A unity utilities library
JUtils.Routines Class Reference

A static class that contains methods for easily creating routines & avoid object allocations More...

Static Public Member Functions

static WaitForSeconds WaitForSeconds (float seconds)
 Faster alternative to WaitForSeconds, caches the object. This will permanently cache the instance unless removed with Coroutines.wfsDictionary More...
 
static WaitForSecondsRealtime WaitForSecondsRealtime (float seconds)
 Faster alternative to creating a new WaitForSecondsRealtime, caches the object. This will permanently cache the instance unless removed with Coroutines.wfsRtDictionary More...
 
static WaitForFixedUpdate WaitForFixedUpdate ()
 Return the cached WaitForFixedUpdate instance More...
 
static WaitForEndOfFrame WaitForEndOfFrame ()
 Return the cached WaitForFixedUpdate instance More...
 
static CoroutineCatcher Catcher ([NotNull] IEnumerator coroutine)
 Returns a CoroutineCatcher More...
 
static IEnumerator NextFrameRoutine ([NotNull] Action action)
 A routine that runs the action in the next frame More...
 
static IEnumerator DelayRoutine (float seconds, [NotNull] Action action)
 A routine that runs the action at the given delay More...
 
static IEnumerator DelayRoutine (TimeSpan timeSpan, [NotNull] Action action)
 A routine that runs the action after the given timespan More...
 
static IEnumerator RunFlat (IEnumerator routine)
 Runs this routine flat – It will not spawn new coroutines when doing yield return SomeRoutine(). More...
 
static IEnumerator ThenRoutine (Coroutine coroutine, [NotNull] Action nextRoutine)
 Runs a action after a coroutine has completed More...
 

Properties

static Dictionary< float, WaitForSecondswfsDictionary [get]
 
static Dictionary< float, WaitForSecondsRealtimewfsRtDictionary [get]
 

Detailed Description

A static class that contains methods for easily creating routines & avoid object allocations

Member Function Documentation

◆ Catcher()

static CoroutineCatcher JUtils.Routines.Catcher ( [NotNull] IEnumerator  coroutine)
inlinestatic

Returns a CoroutineCatcher

◆ DelayRoutine() [1/2]

static IEnumerator JUtils.Routines.DelayRoutine ( float  seconds,
[NotNull] Action  action 
)
inlinestatic

A routine that runs the action at the given delay

References JUtils.Routines.WaitForSeconds().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DelayRoutine() [2/2]

static IEnumerator JUtils.Routines.DelayRoutine ( TimeSpan  timeSpan,
[NotNull] Action  action 
)
inlinestatic

A routine that runs the action after the given timespan

References JUtils.Routines.WaitForSeconds().

Here is the call graph for this function:

◆ NextFrameRoutine()

static IEnumerator JUtils.Routines.NextFrameRoutine ( [NotNull] Action  action)
inlinestatic

A routine that runs the action in the next frame

Here is the caller graph for this function:

◆ RunFlat()

static IEnumerator JUtils.Routines.RunFlat ( IEnumerator  routine)
inlinestatic

Runs this routine flat – It will not spawn new coroutines when doing yield return SomeRoutine().

◆ ThenRoutine()

static IEnumerator JUtils.Routines.ThenRoutine ( Coroutine  coroutine,
[NotNull] Action  nextRoutine 
)
inlinestatic

Runs a action after a coroutine has completed

Here is the caller graph for this function:

◆ WaitForEndOfFrame()

static WaitForEndOfFrame JUtils.Routines.WaitForEndOfFrame ( )
inlinestatic

Return the cached WaitForFixedUpdate instance

◆ WaitForFixedUpdate()

static WaitForFixedUpdate JUtils.Routines.WaitForFixedUpdate ( )
inlinestatic

Return the cached WaitForFixedUpdate instance

◆ WaitForSeconds()

static WaitForSeconds JUtils.Routines.WaitForSeconds ( float  seconds)
inlinestatic

Faster alternative to WaitForSeconds, caches the object. This will permanently cache the instance unless removed with Coroutines.wfsDictionary

References JUtils.Routines.wfsDictionary.

Here is the caller graph for this function:

◆ WaitForSecondsRealtime()

static WaitForSecondsRealtime JUtils.Routines.WaitForSecondsRealtime ( float  seconds)
inlinestatic

Faster alternative to creating a new WaitForSecondsRealtime, caches the object. This will permanently cache the instance unless removed with Coroutines.wfsRtDictionary

References JUtils.Routines.wfsDictionary, and JUtils.Routines.wfsRtDictionary.

Property Documentation

◆ wfsDictionary

Dictionary<float, WaitForSeconds> JUtils.Routines.wfsDictionary
staticget

◆ wfsRtDictionary

Dictionary<float, WaitForSecondsRealtime> JUtils.Routines.wfsRtDictionary
staticget

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