JUtils
A unity utilities library
JUtils.CoroutineCatcher Class Reference

Wrapper for troublesome coroutines More...

Inheritance diagram for JUtils.CoroutineCatcher:
Collaboration diagram for JUtils.CoroutineCatcher:

Public Member Functions

 CoroutineCatcher (IEnumerator coroutine)
 This allows you to catch errors in enumerators More...
 
bool HasThrown (out Exception exception)
 Check if the coroutine has thrown an exception More...
 
bool MoveNext ()
 Move to the next element in the enumerator More...
 
void Reset ()
 Reset the enumerator More...
 

Properties

object Current [get]
 Get the current value of the enumerator More...
 

Detailed Description

Wrapper for troublesome coroutines

private IEnumerator EnterShipRoutine()
{
playerMovement.Freeze();
CoroutineCatcher catcher = Routines.Catcher(MoveIntoShip());
yield return cather; // Runs the TroublesomeRoutine
if (catcher.HasThrown(out Exception exception)) {
Debug.LogException(catcher.exception);
}
playerMovement.UnFreeze();
}
CoroutineCatcher(IEnumerator coroutine)
This allows you to catch errors in enumerators
Definition: CoroutineCatcher.cs:33

Constructor & Destructor Documentation

◆ CoroutineCatcher()

JUtils.CoroutineCatcher.CoroutineCatcher ( IEnumerator  coroutine)
inline

This allows you to catch errors in enumerators

Member Function Documentation

◆ HasThrown()

bool JUtils.CoroutineCatcher.HasThrown ( out Exception  exception)
inline

Check if the coroutine has thrown an exception

◆ MoveNext()

bool JUtils.CoroutineCatcher.MoveNext ( )
inline

Move to the next element in the enumerator

◆ Reset()

void JUtils.CoroutineCatcher.Reset ( )
inline

Reset the enumerator

Property Documentation

◆ Current

object JUtils.CoroutineCatcher.Current
get

Get the current value of the enumerator


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