Struct Deferred
Handle to read data of a promise.
Namespace: UnityEngine.Promise
Syntax
public struct Deferred
Properties
currentStep
Gets the index of the current step of the promise.
Declaration
public int currentStep { get; }
Property Value
Type | Description |
---|---|
Int32 |
error
The exception that prevented the handled promise to be fulfilled if it has been rejected.
Declaration
public Exception error { get; }
Property Value
Type | Description |
---|---|
Exception |
isActive
Declaration
public bool isActive { get; }
Property Value
Type | Description |
---|---|
Boolean |
isDone
A flag to determine if the handled promise has been fulfilled or rejected.
Declaration
public bool isDone { get; }
Property Value
Type | Description |
---|---|
Boolean |
isFulfilled
A flag to determine if the handled promise has been fulfilled.
Declaration
public bool isFulfilled { get; }
Property Value
Type | Description |
---|---|
Boolean |
totalSteps
Gets the number of steps of the promise.
Declaration
public int totalSteps { get; }
Property Value
Type | Description |
---|---|
Int32 |
Methods
GetProgression(out Int32, out Int32)
Gets the progression of the promise.
Declaration
public void GetProgression(out int currentStep, out int totalSteps)
Parameters
Type | Name | Description |
---|---|---|
Int32 | currentStep | The index of the current step the promise is at. |
Int32 | totalSteps | The number of steps of the promise. |
Release()
Resets the handled promise in order to recycle it.
Declaration
public void Release()
Wait()
Returns an IEnumerator instance so it can be used in the context of a coroutine.
Declaration
public IEnumerator Wait()
Returns
Type | Description |
---|---|
IEnumerator | An IEnumerator instance to use in a coroutine. |