New in 1.8.1 coming soon...
The ActionTarget system lets you define Object types that Actions work with.
This information allows the Playmaker Editor to offer smart context menus e.g., for drag and drop operations.
There are 2 ways Action Targets are defined:
- Using an ActionTargetAttribute.
- Generated automatically by looking at action parameters.
All actions are scanned using these rules:
- If an Action has a NoActionTargetsAttribute it is skipped.
- If an Action already has ActionTargetAttributes it is skipped.
- If a field is marked with CheckForComponent we add an ActionTarget for that Component type.
- If a field has an ObjectTypeAttribute we add an ActionTarget for that Object type.
- If a field is of FsmMaterial or Material type we add an ActionTarget for Materials.
- If a field is of FsmTexture or Texture type we add an ActionTarget for Textures.
- If a field is of FsmOwnerDefault, FsmGameObject, or GameObject type we add a GameObject ActionTarget.
- If a field is of CollisionType or TriggerType we add RigidBody, Collider, and GameObject ActionTargets.
- If a field is of Collision2DType or Trigger2DType we add RigidBody2D, and Collider2D ActionTargets.
- If a field has a UIHint.Animation attribute we add an Animation ActionTarget.
These rules are followed top to bottom. Only one ActionTarget can exist for an Action and an Object type. So the first rule that defines an ActionTarget "wins".
When assigning an Object type to an action field, the editor can convert between common types. E.g., Setting a GameObject field to a Component will fetch the Component.gameObject.
You can use this ActionTargetInspector tool to review the results of scanning for ActionTargets: