Class AsyncOperationBase<TObject> | Addressables | 1.6.2
docs.unity3d.com
    Show / Hide Table of Contents

    Class AsyncOperationBase<TObject>

    base class for implemented AsyncOperations, implements the needed interfaces and consolidates redundant code

    Inheritance
    Object
    AsyncOperationBase<TObject>
    Inherited Members
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: UnityEngine.ResourceManagement.AsyncOperations
    Syntax
    public abstract class AsyncOperationBase<TObject> : IAsyncOperation
    Type Parameters
    Name Description
    TObject

    Constructors

    AsyncOperationBase()

    Declaration
    protected AsyncOperationBase()

    Properties

    DebugName

    A custom operation should override this method to provide a debug friendly name for the operation.

    Declaration
    protected virtual string DebugName { get; }
    Property Value
    Type Description
    String

    Progress

    A custom operation should override this method to return the progress of the operation.

    Declaration
    protected virtual float Progress { get; }
    Property Value
    Type Description
    Single

    Progress of the operation. Value should be between 0.0f and 1.0f

    Result

    Accessor to Result of the operation.

    Declaration
    public TObject Result { get; set; }
    Property Value
    Type Description
    TObject

    Methods

    Complete(TObject, Boolean, String)

    Complete the operation and invoke events.

    Declaration
    public void Complete(TObject result, bool success, string errorMsg)
    Parameters
    Type Name Description
    TObject result

    The result object for the operation.

    Boolean success

    True if successful.

    String errorMsg

    The error message if the operation has failed.

    Destroy()

    This will be called by the resource manager when the reference count of the operation reaches zero. This method should not be called manually. A custom operation should override this method and release any held resources

    Declaration
    protected virtual void Destroy()

    Execute()

    This will be called by the resource manager after all dependent operation complete. This method should not be called manually. A custom operation should override this method and begin work when it is called.

    Declaration
    protected abstract void Execute()

    GetDependencies(List<AsyncOperationHandle>)

    A custom operation should override this method to provide a list of AsyncOperationHandles that it depends on.

    Declaration
    protected virtual void GetDependencies(List<AsyncOperationHandle> dependencies)
    Parameters
    Type Name Description
    List<AsyncOperationHandle> dependencies

    The list that should be populated with dependent AsyncOperationHandles.

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    String
    Overrides
    Object.ToString()
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023