Struct SelectorTask
The selector task executes all of its children in order until it encounters a non-failure status.
Namespace: Unity.Kinematica
Syntax
[Data("Selector", "#2A5637", DataType.Flag.None)]
public struct SelectorTask : Task
Methods
Action()
Creates a new action task as a child of the selector task.
Declaration
public ActionTask Action()
Returns
| Type | Description |
|---|---|
| ActionTask | Reference to the newly created action task. |
Condition()
Creates a new condition task as a child of the selector task.
Declaration
public ConditionTask Condition()
Returns
| Type | Description |
|---|---|
| ConditionTask | Reference to the newly created condition task. |
Execute()
Execute method for the selector task.
Declaration
public Result Execute()
Returns
| Type | Description |
|---|---|
| Result | Result of the child task that didn't execute with a failure status; success if the selector task has no children. |
Implements
Remarks
The selector task executes all of its children in order until it encounters a non-failure status.
ExecuteSelf(ref TaskRef)
Surrogate method for automatic task execution.
Declaration
public static Result ExecuteSelf(ref TaskRef self)
Parameters
| Type | Name | Description |
|---|---|---|
| TaskRef | self | Task reference that is supposed to be executed. |
Returns
| Type | Description |
|---|---|
| Result | Result of the task execution. |
Parallel()
Creates a new parallel task as a child of the selector task.
Declaration
public ParallelTask Parallel()
Returns
| Type | Description |
|---|---|
| ParallelTask | Reference to the newly created parallel task. |
Selector()
Creates a new selector task as a child of the selector task.
Declaration
public SelectorTask Selector()
Returns
| Type | Description |
|---|---|
| SelectorTask | Reference to the newly created selector task. |
Sequence(Boolean, Boolean)
Creates a new sequence task as a child of the selector task.
Declaration
public SequenceTask Sequence(bool loop = false, bool resetWhenNotExecuted = true)
Parameters
| Type | Name | Description |
|---|---|---|
| Boolean | loop | If false, once the sequence has finished executing all its children, it will do nothing and just return success. If true, sequence will reexecute all its children tasks indefinitely. |
| Boolean | resetWhenNotExecuted | If true, and if the sequence isn't executed during one task graph pass, next time the sequence will be executed again, it will restart execution from its first child. |
Returns
| Type | Description |
|---|---|
| SequenceTask | Reference to the newly created sequence task. |
Operators
Implicit(SelectorTask to Identifier<SelectorTask>)
Implicit cast operator that allows to convert a selector task into a typed identifier.
Declaration
public static implicit operator Identifier<SelectorTask>(SelectorTask task)
Parameters
| Type | Name | Description |
|---|---|---|
| SelectorTask | task |
Returns
| Type | Description |
|---|---|
| Identifier<SelectorTask> |
Implicit(SelectorTask to MemoryIdentifier)
Implicit cast operator that allows to convert a selector task into an identifier.
Declaration
public static implicit operator MemoryIdentifier(SelectorTask task)
Parameters
| Type | Name | Description |
|---|---|---|
| SelectorTask | task |
Returns
| Type | Description |
|---|---|
| MemoryIdentifier |