Operational Actions | Package Manager UI website
docs.unity3d.com
    Show / Hide Table of Contents

    Operational Actions

    While the plan definition contains specifications for the requirements and effects of actions, operational actions govern the execution of actions within the game/simulation.

    All operational action scripts must implement the IOperationalAction<TAgent> interface, which requires methods for beginning, continuing, ending, and monitoring the status of the actions. Each method is defined over the following arguments:

    • State Entity - An ECS entity for the state in which the action is being taken.
    • Action Context - The context of the action within the plan.
    • Agent - The agent which will perform the action. This is the same Agent class in [BaseAgent](BaseAgent.md

    Operational Action Status

    OperationalActionStatus Status(Entity stateEntity, ActionContext action, TAgent agent)
    

    Operational actions are responsible for reporting the status of the action to the Controller. This method is called each frame until the action is completed or determined no longer valid. The possible values of the OperationalActionStatus are:

    • InProgress
    • NoLongerValid
    • Complete

    Begin Execution

    void BeginExecution(Entity stateEntity, ActionContext action, TAgent agent)
    

    BeginExecution is called once, at the start of each action.

    Continue Execution

    void ContinueExecution(Entity stateEntity, ActionContext action, TAgent agent)
    

    ContinueExecution is called each frame until the action is determined to be Complete or NoLongerValid.

    End Execution

    void EndExecution(Entity stateEntity, ActionContext action, TAgent agent)
    

    EndExecution is called once, after the action is reported Complete or NoLongerValid.

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023