Class ActionResult
Contains information about the results of a ProBuilder action (success, failure, and other notifications)
Inherited Members
Namespace: UnityEngine.ProBuilder
Syntax
public sealed class ActionResult
Constructors
ActionResult(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 |
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 |
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 |
Methods
FromBool(Boolean)
Returns the value of the specified success
value.
Declaration
public static bool FromBool(bool success)
Parameters
Type | Name | Description |
---|---|---|
Boolean | success | Boolean value to check. |
Returns
Type | Description |
---|---|
Boolean | 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 |
---|---|
Boolean | True if this ActionResult has a status of Success; false otherwise. |
Operators
Implicit(ActionResult to Boolean)
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 |
---|---|
Boolean | True if action was Success; false otherwise. |