Search Results for

    Show / Hide Table of Contents

    Class TaskActions

    List of shortcuts to schedule actions on an agent

    Inheritance
    Object
    TaskActions
    Namespace: i5.VirtualAgents.ScheduleBasedExecution
    Assembly: cs.temp.dll.dll
    Syntax
    public class TaskActions

    Constructors

    TaskActions(ScheduleBasedTaskSystem)

    Creates a new task actions shortcut and registers the schedule system on which the tasks are scheduled

    Declaration
    public TaskActions(ScheduleBasedTaskSystem scheduleTaskSystem)
    Parameters
    Type Name Description
    ScheduleBasedTaskSystem scheduleTaskSystem

    The agent on which the tasks are scheduled and executed

    Methods

    ActivateOrDeactivateAdaptiveGaze(Boolean, Int32)

    Creates an adaptiveGazeTask that activates or deactivates the AdaptiveGaze component on the agent

    Declaration
    public void ActivateOrDeactivateAdaptiveGaze(bool shouldStartOrStop, int priority = 0)
    Parameters
    Type Name Description
    Boolean shouldStartOrStop

    If true, will start adaptive Gaze. If false will stop adaptive gaze

    Int32 priority

    Priority of the task. Tasks with high importance should get a positive value, less important tasks a negative value. Default tasks have a priority of 0.

    DropItem(GameObject, Int32)

    Drop one specified or all object that are currently attached to the agent and have the Item component Shortcut queue management function

    Declaration
    public AgentBaseTask DropItem(GameObject dropObject = null, int priority = 0)
    Parameters
    Type Name Description
    GameObject dropObject

    The item that should be dropped, no item will result in all items being dropped

    Int32 priority

    Priority of the task. Tasks with high importance should get a positive value, less important tasks a negative value. Default tasks have a priority of 0.

    Returns
    Type Description
    AgentBaseTask

    GoTo(GameObject, Vector3, Int32, Boolean)

    Creates an AgentMovementTask for walking/running to a specific gameobject and schedules it or forces its execution. Shortcut queue management function

    Declaration
    public AgentBaseTask GoTo(GameObject destinationObject, Vector3 offset = null, int priority = 0, bool follow = false)
    Parameters
    Type Name Description
    GameObject destinationObject

    GameObject the agent should go to

    Vector3 offset
    Int32 priority

    Priority of the task. Tasks with high importance should get a positive value, less important tasks a negative value. Default tasks have a priority of 0.

    Boolean follow

    Decides if the Agent should follow the GameObject, dynamically, even if the path cannot reach the GameObject

    Returns
    Type Description
    AgentBaseTask

    GoTo(Transform, Vector3, Int32)

    Creates an AgentMovementTask for walking/running and schedules it or forces its execution. Shortcut queue management function

    Declaration
    public AgentBaseTask GoTo(Transform destinationTransform, Vector3 offset = null, int priority = 0)
    Parameters
    Type Name Description
    Transform destinationTransform
    Vector3 offset
    Int32 priority

    Priority of the task. Tasks with high importance should get a positive value, less important tasks a negative value. Default tasks have a priority of 0.

    Returns
    Type Description
    AgentBaseTask

    GoTo(Vector3, Int32)

    Creates an AgentMovementTask for walking/running and schedules it or forces its execution. Shortcut queue management function

    Declaration
    public AgentBaseTask GoTo(Vector3 destinationCoordinates, int priority = 0)
    Parameters
    Type Name Description
    Vector3 destinationCoordinates

    Position the agent should go to

    Int32 priority

    Priority of the task. Tasks with high importance should get a positive value, less important tasks a negative value. Default tasks have a priority of 0.

    Returns
    Type Description
    AgentBaseTask

    GoToAndDropItem(Transform, GameObject, Int32)

    Go to a transform and drop one specified or all object that are currently attached to the agent and have the Item component Shortcut queue management function

    Declaration
    public AgentBaseTask GoToAndDropItem(Transform destinationTransform, GameObject dropObject = null, int priority = 0)
    Parameters
    Type Name Description
    Transform destinationTransform

    Transform the agent should go to

    GameObject dropObject

    The item that should be dropped, no item will result in all items being dropped

    Int32 priority

    Priority of the task. Tasks with high importance should get a positive value, less important tasks a negative value. Default tasks have a priority of 0.

    Returns
    Type Description
    AgentBaseTask

    GoToAndDropItem(Vector3, GameObject, Int32)

    Go to coordinates and drop one specified or all object that are currently attached to the agent and have the Item component Shortcut queue management function

    Declaration
    public AgentBaseTask GoToAndDropItem(Vector3 destinationCoordinates, GameObject dropObject = null, int priority = 0)
    Parameters
    Type Name Description
    Vector3 destinationCoordinates

    Position the agent should go to

    GameObject dropObject

    The item that should be dropped, no item will result in all items being dropped

    Int32 priority

    Priority of the task. Tasks with high importance should get a positive value, less important tasks a negative value. Default tasks have a priority of 0.

    Returns
    Type Description
    AgentBaseTask

    GoToAndPickUp(GameObject, Int32, SocketId, Single)

    Go to an object with the Item component and pick it up when near enough. Might fail, when object is moving too fast. Shortcut queue management function

    Declaration
    public AgentBaseTask GoToAndPickUp(GameObject destinationObject, int priority = 0, SocketId bodyAttachPoint = null, float minDistance = 0.3F)
    Parameters
    Type Name Description
    GameObject destinationObject

    Object the agent should go to and pick up. Needs to have an item component and be reachable by the agent.

    Int32 priority

    Priority of the task. Tasks with high importance should get a positive value, less important tasks a negative value. Default tasks have a priority of 0.

    SocketId bodyAttachPoint

    Bodypart that the object should be attached to, standard is the right Hand

    Single minDistance

    Distance at which the the agent will try to pick up the object

    Returns
    Type Description
    AgentBaseTask

    PickUp(GameObject, Int32, SocketId)

    Pick up an object with the Item component that is currently in reach of the agent Shortcut queue management function

    Declaration
    public AgentBaseTask PickUp(GameObject pickupObject, int priority = 0, SocketId bodyAttachPoint = null)
    Parameters
    Type Name Description
    GameObject pickupObject

    Object that should be picked up. Needs to have an item component and be near to the agent.

    Int32 priority

    Priority of the task. Tasks with high importance should get a positive value, less important tasks a negative value. Default tasks have a priority of 0.

    SocketId bodyAttachPoint

    Bodypart that the object should be attached to, standard is the right Hand

    Returns
    Type Description
    AgentBaseTask

    PlayAnimation(String, Single, String, Int32, String, GameObject)

    Play an animation through the agents animation controller Shortcut queue management function

    Declaration
    public AgentBaseTask PlayAnimation(string startTrigger, float playTime, string stopTrigger = "", int priority = 0, string layer = "Base Layer", GameObject aimTarget = null)
    Parameters
    Type Name Description
    String startTrigger

    Trigger that starts the animation

    Single playTime

    Time in seconds after which the animation should stop

    String stopTrigger

    Trigger that stops the animation. If not provided, start trigger is used again

    Int32 priority

    Priority of the task. Tasks with high importance should get a positive value, less important tasks a negative value. Default tasks have a priority of 0.

    String layer

    The animation layer on which the task should be excuted

    GameObject aimTarget

    The target at which the agent should aim while playing the animation

    Returns
    Type Description
    AgentBaseTask

    StartAdaptiveGazeForTime(Single, Int32)

    Creates an adaptiveGazeTask that activates the AdaptiveGaze component, then a wait task on the head and then a task that deactivates the AdaptiveGaze component. These a scheduled so that they play one after another.

    Declaration
    public AgentBaseTask[] StartAdaptiveGazeForTime(float seconds, int priority = 0)
    Parameters
    Type Name Description
    Single seconds

    Time in seconds after which the gazing should stop

    Int32 priority

    Priority of the task. Tasks with high importance should get a positive value, less important tasks a negative value. Default tasks have a priority of 0.

    Returns
    Type Description
    AgentBaseTask[]

    Returs a AgentBaseTask array with two elements. The first has the starting Task (e.g. for startTask.waitFor(diffrentTask), and the second the stop Task ((e.g. for diffrentTask.waitFor(stopTask))

    WaitForSeconds(Single, Int32, String)

    Lets the agent wait for the given number of seconds in an idle position Shortcut queue management function

    Declaration
    public AgentBaseTask WaitForSeconds(float seconds, int priority = 0, string layer = "Base Layer")
    Parameters
    Type Name Description
    Single seconds

    The time span in seconds for which the agent shoudl wait

    Int32 priority

    Priority of the task. Tasks with high importance should get a positive value, less important tasks a negative value. Default tasks have a priority of 0.

    String layer

    The animation layer on which the task should be excuted

    Returns
    Type Description
    AgentBaseTask
    In This Article
    Back to top Documentation of the Virtual Agents Framework