docs.unity.cn
    Show / Hide Table of Contents

    Struct Completer

    Handle to settle a promise.

    Namespace: UnityEngine.Promise
    Syntax
    public struct Completer

    Properties

    isActive

    Tells whether this Completer is active or not. A Completer is active while its Deferred is not released.

    Declaration
    public bool isActive { get; }
    Property Value
    Type Description
    Boolean

    None

    Can be used to replace a completer for process you don't need the feedback from.

    Declaration
    public static Completer None { get; }
    Property Value
    Type Description
    Completer

    Methods

    Reject(Exception)

    Rejects the handled promise for the given reason.

    Declaration
    public void Reject(Exception reason)
    Parameters
    Type Name Description
    Exception reason

    The exception that prevented the handled promise to be fulfilled.

    Resolve()

    Fulfills the handled promise.

    Declaration
    public void Resolve()

    SetProgression(Int32, Int32)

    Sets the progression of the promise.

    Declaration
    public void SetProgression(int currentStep, int totalSteps)
    Parameters
    Type Name Description
    Int32 currentStep

    The index of the current step the promise is at.

    Int32 totalSteps

    The total number of steps of the promise.

    Operators

    Implicit(Completer to Rejectable)

    Implicitly converts a Completer into a Rejectable in case a method only needs to be able to reject the promise.

    Declaration
    public static implicit operator Rejectable(Completer completer)
    Parameters
    Type Name Description
    Completer completer

    The completer to convert.

    Returns
    Type Description
    Rejectable

    The Rejectable for the given completer.

    Back to top Copyright © 2020 Unity Technologies
    Generated by DocFX
    on 16 June 2021