Interface IAsyncOperation
Base interface of all async ops
Namespace: UnityEngine.ResourceManagement.AsyncOperations
Syntax
public interface IAsyncOperation : IEnumerator
Properties
Context
Gets the context object related to this operation, usually set to the IResourceLocation.
Declaration
object Context { get; }
Property Value
Type | Description |
---|---|
System.Object | The context object. |
IsDone
Gets a value indicating whether this ResourceManagement.IAsyncOperation is done.
Declaration
bool IsDone { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
IsValid
used by Validate to ensure operation is in correct state
Declaration
bool IsValid { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Key
Gets the key related to this operation, usually set to the address.
Declaration
object Key { get; set; }
Property Value
Type | Description |
---|---|
System.Object | The context object. |
OperationException
Gets the exception that caused this operation to change its status to Failure.
Declaration
Exception OperationException { get; }
Property Value
Type | Description |
---|---|
System.Exception | The exception. |
PercentComplete
Gets the percent complete of this operation.
Declaration
float PercentComplete { get; }
Property Value
Type | Description |
---|---|
System.Single | The percent complete. |
Result
Gets the result.
Declaration
object Result { get; }
Property Value
Type | Description |
---|---|
System.Object | The result. |
Status
returns the status of the operation
Declaration
AsyncOperationStatus Status { get; }
Property Value
Type | Description |
---|---|
AsyncOperationStatus | Enum indicating success or failure of the operation. |
Methods
Release()
Release operation back to internal cache. This can be used to avoid garbage collection.
Declaration
void Release()
ResetStatus()
Reset status and error
Declaration
void ResetStatus()
Retain()
Internally marks operations to not automatically release back to the cache.
Declaration
IAsyncOperation Retain()
Returns
Type | Description |
---|---|
IAsyncOperation | Passes back this |
Validate()
internal integrity check
Declaration
bool Validate()
Returns
Type | Description |
---|---|
System.Boolean |
Events
Completed
Occurs when completed.
Declaration
event Action<IAsyncOperation> Completed
Event Type
Type | Description |
---|---|
System.Action<IAsyncOperation> |