Skip to content

InteractionResult

Namespace: FireSoftworks.Interaction
Assembly: FireSoftworks.Interaction
Type: Struct

Represents the result of an executed interaction action. Contains a success flag and an optional message describing the outcome. This struct is serializable for logging and debugging purposes.

[Serializable]
public struct InteractionResult

Methods

Fail(string)

Creates a failed interaction result with an optional error message.

public static InteractionResult Fail(string message = null)

Parameters

NameTypeDescription
messageSystem.StringOptional error message explaining why the action failed.

Returns: An InteractionResult marked as failed.

Ok(string)

Creates a successful interaction result with an optional message.

public static InteractionResult Ok(string message = null)

Parameters

NameTypeDescription
messageSystem.StringOptional message describing the successful action.

Returns: An InteractionResult marked as successful.

Fields

Message

Optional message providing additional information about the result. Useful for debugging or displaying feedback to the player.

public string Message

Success

Indicates whether the action executed successfully.

public bool Success