Task Attributes
Task attributes control how a custom task is named, organized, documented,
validated, and drawn in the Behavior Designer editor.
Class attributes
| Attribute | Editor effect |
|---|---|
HelpURL |
Opens the supplied documentation URL from the task Inspector. |
TaskIcon |
Assigns an icon path or light/dark icon GUIDs. {SkinColor} in a path resolves to Light or Dark. |
TaskName |
Replaces the class name in the task list and graph. |
TaskCategory |
Places the task in a category; use / for nested categories. |
TaskDescription |
Shows the description in the graph when descriptions are enabled. |
RequiredComponent |
Declares a component that the task owner must contain. The attribute can be repeated. |
SkipErrorCheck |
Excludes the task from realtime error checking; use only when custom validation replaces it. |
using BehaviorDesigner.Runtime;
using BehaviorDesigner.Runtime.Tasks;
using UnityEngine;
[BehaviorDesigner.Runtime.Tasks.HelpURL("https://example.com/tasks/find-cover")]
[TaskCategory("Combat/Cover")]
[TaskName("Find Cover")]
[TaskDescription("Finds a reachable cover position near the agent.")]
[RequiredComponent(typeof(Collider))]
public class FindCover : Action
{
}
Field attributes
| Attribute | Editor effect |
|---|---|
Tooltip |
Shows guidance for the field. |
RequiredField |
Reports an error when the field has no value. |
SharedRequired |
Requires the field to reference a shared variable rather than a constant. |
LinkedTask |
Keeps reciprocal task references synchronized. |
InspectTask |
Draws the referenced task’s fields inline. |
ObjectDrawerAttribute subclass |
Selects a custom Object Drawer for the field. |
[BehaviorDesigner.Runtime.Tasks.Tooltip("The target selected by a sensing task.")]
[RequiredField]
public SharedGameObject Target;
Verify the editor presentation
Allow Unity to compile, reopen the Behavior Designer window, and add the task
from its new category. Confirm its display name, description, help link, icon,
and required-field warning. If an attribute has no effect, check that it comes
from BehaviorDesigner.Runtime.Tasks and is applied to the supported class or
field target.
See Object Drawers for custom field rendering and
Referencing Tasks for linked task fields.