docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class ActionResult

    Contains information about the results of a ProBuilder action (success, failure, and other notifications)

    Inheritance
    object
    ActionResult
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.ProBuilder
    Assembly: Unity.ProBuilder.dll
    Syntax
    public sealed class ActionResult

    Constructors

    ActionResult(Status, string)

    Creates a new ActionResult with a specific status value.

    Declaration
    public ActionResult(ActionResult.Status status, string notification)
    Parameters
    Type Name Description
    ActionResult.Status status

    Status value to use for the action.

    string notification

    A short summary of the action performed.

    Properties

    NoSelection

    Creates a generic "No Selection" action result with "Nothing Selected" notification.

    Declaration
    public static ActionResult NoSelection { get; }
    Property Value
    Type Description
    ActionResult

    Success

    Creates a generic "Success" action result with no notification text.

    Declaration
    public static ActionResult Success { get; }
    Property Value
    Type Description
    ActionResult

    UserCanceled

    Creates a generic "Canceled" action result with "User Canceled" notification.

    Declaration
    public static ActionResult UserCanceled { get; }
    Property Value
    Type Description
    ActionResult

    notification

    Gets the short description of the results (a few words long).

    Declaration
    public string notification { get; }
    Property Value
    Type Description
    string

    status

    Gets the status of the action following the operation.

    Declaration
    public ActionResult.Status status { get; }
    Property Value
    Type Description
    ActionResult.Status

    Methods

    FromBool(bool)

    Returns the value of the specified success value.

    Declaration
    public static bool FromBool(bool success)
    Parameters
    Type Name Description
    bool success

    Boolean value to check.

    Returns
    Type Description
    bool

    Generic boolean value corresponding to the success parameter.

    ToBool()

    Checks whether the current ActionResult is set to Success or not.

    Declaration
    public bool ToBool()
    Returns
    Type Description
    bool

    True if this ActionResult has a status of Success; false otherwise.

    Operators

    implicit operator bool(ActionResult)

    Converts the specified result to a boolean value, where true indicates success.

    Declaration
    public static implicit operator bool(ActionResult res)
    Parameters
    Type Name Description
    ActionResult res

    ActionResult to convert.

    Returns
    Type Description
    bool

    True if action was Success; false otherwise.

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)