Search Results for

    Show / Hide Table of Contents

    Interface IUtilityAction

    The base implementation for Utility Action to be used by the planner.

    Namespace: TinnyStudios.AIUtility
    Assembly: UtilityAIFramework.dll
    Syntax
    public interface IUtilityAction

    Properties

    Considerations

    The list of considerations. Think of a consideration as a question of how much you want to do something. i.e a consideration for EatAction is how hungry are you? If you are very hungry, it will return 1. The list of consideration total score average is the Action's Score.

    Declaration
    List<Consideration> Considerations { get; }
    Property Value
    Type Description
    List<Consideration>

    Events

    A list of unity events for ease of use.

    Declaration
    UtilityAction.ActionEvents Events { get; }
    Property Value
    Type Description
    UtilityAction.ActionEvents

    FoldOutEnabled

    To show more info, only used for editor purposes.

    Declaration
    bool FoldOutEnabled { get; set; }
    Property Value
    Type Description
    Boolean

    Initialized

    Set up has been completed so we won't do it a second time.

    Declaration
    bool Initialized { get; set; }
    Property Value
    Type Description
    Boolean

    MoveData

    The Action Move Data stores useful data to pass to the Move System.

    Declaration
    ActionMoveData MoveData { get; }
    Property Value
    Type Description
    ActionMoveData

    Name

    The name of the action, mostly used for debugging purposes.

    Declaration
    string Name { get; }
    Property Value
    Type Description
    String

    PropertySet

    Declaration
    PropertySetRuntime PropertySet { get; }
    Property Value
    Type Description
    PropertySetRuntime

    Score

    The last evaluated Score of the Action. The higher score will get chosen by the Planner.

    Declaration
    float Score { get; }
    Property Value
    Type Description
    Single

    State

    The last known state of the action. Useful for debugging purposes.

    Declaration
    EActionStatus State { get; }
    Property Value
    Type Description
    EActionStatus

    TimeWatch

    Stores the time elapsed of the performing action.

    Declaration
    TimeWatcher TimeWatch { get; }
    Property Value
    Type Description
    TimeWatcher

    Weight

    The action score is multiplied by the weight. This determines its max score output and can be use for classifying priorities.

    Declaration
    float Weight { get; }
    Property Value
    Type Description
    Single

    Methods

    IsAvailable()

    This is checked before the action is scored. This is useful for simply telling an action to not occur via code. It's basically a coded approach to considerations.

    Declaration
    bool IsAvailable()
    Returns
    Type Description
    Boolean

    OnConsiderationCheck(Consideration)

    This is called just before a consideration is checked. This gives time for us to bind any neccessary data.

    Declaration
    void OnConsiderationCheck(Consideration consideration)
    Parameters
    Type Name Description
    Consideration consideration

    OnMove(MoveSystemBase)

    Called Once Per Frame. Assign destination to Destination Transform by default. Override this method to change the target destination, i.e a location without a transform. You can use this to override Move System or simply modify its speed. Transform is kept default for convenience sake

    Declaration
    void OnMove(MoveSystemBase moveSystem)
    Parameters
    Type Name Description
    MoveSystemBase moveSystem

    OnMoveStarted(MoveSystemBase)

    Is called when the Agent just started moving to its target to perform the action.

    Declaration
    void OnMoveStarted(MoveSystemBase moveSystem)
    Parameters
    Type Name Description
    MoveSystemBase moveSystem

    OnReachedDestination()

    Is called when the Agent reached the destination. This is not called if MoveData Required field is not enabled.

    Declaration
    void OnReachedDestination()

    Perform(Agent)

    Is called when the action can be executed. i.e within range. Returning EActionStatus.Completed will end the action and the agent will find a new plan. Returning EActionStatus.Running will continue. Returning EActionStatus.Failed will allow to Agent to know to Abort the action.

    Declaration
    EActionStatus Perform(Agent agent)
    Parameters
    Type Name Description
    Agent agent
    Returns
    Type Description
    EActionStatus

    SetScore(Single)

    Declaration
    void SetScore(float getRescaleScore)
    Parameters
    Type Name Description
    Single getRescaleScore

    SetState(EActionStatus)

    Sets the ActionStatus of the Agent. This does not transition and is used more for tracking.

    Declaration
    void SetState(EActionStatus state)
    Parameters
    Type Name Description
    EActionStatus state

    Setup(Agent)

    Sets up the action, useful for any initialization.

    Declaration
    void Setup(Agent agent)
    Parameters
    Type Name Description
    Agent agent
    In This Article
    Back to top Generated by DocFX