Show / Hide Table of Contents

Class SmartCoroutine<TValue>

Inheritance
System.Object
SmartCoroutine<TValue>
Namespace: Edgar.Unity
Assembly: cs.temp.dll.dll
Syntax
public class SmartCoroutine<TValue>
Type Parameters
Name Description
TValue

Constructors

SmartCoroutine(IEnumerator, Boolean)

Initialize the smart coroutine with another coroutine.

Declaration
public SmartCoroutine(IEnumerator coroutine, bool throwImmediately = false)
Parameters
Type Name Description
System.Collections.IEnumerator coroutine

Coroutine that should be wrapped in the smart coroutine.

System.Boolean throwImmediately

Whether to throw immediately if an exception is encountered.

Properties

Coroutine

Coroutine that wraps the smart coroutine. Must be set manually after calling StartCoroutine(coroutineObject.InternalCoroutine).

Declaration
public Coroutine Coroutine { get; set; }
Property Value
Type Description
Coroutine

Exception

Exception that was thrown during execution, null if there was no exception.

Declaration
public Exception Exception { get; }
Property Value
Type Description
Exception

InternalCoroutine

Actual logic of the coroutine.

Declaration
public IEnumerator InternalCoroutine { get; }
Property Value
Type Description
System.Collections.IEnumerator

IsFinished

Whether the coroutine has already finished.

Declaration
public bool IsFinished { get; }
Property Value
Type Description
System.Boolean

IsSuccessful

Whether there was an exception or not.

Declaration
public bool IsSuccessful { get; }
Property Value
Type Description
System.Boolean

Value

Value that was returned from the coroutine. If no value was returned, default value is returned by this property.

Declaration
public TValue Value { get; }
Property Value
Type Description
TValue

Methods

ThrowIfNotSuccessful()

Rethrow the exception if there was any.

Declaration
public void ThrowIfNotSuccessful()
In This Article
Back to top Generated by DocFX