You can add Attributes to actions to customize their appearance in the Playmaker editor.
Attribute | Description | |
---|---|---|
ActionTarget |
(New in 1.8.1 coming soon)
Defines an Object type that the Action works with. So that Playmaker can make relevant context menus, e.g., for drag and drop.
Parameters: ObjectType: Defines the Object type that the Action works with. FieldName: Defines the name of a field to set to the value of the target Object.
NOTE: The ActionTarget system can convert between common Object targets. See ActionTargets.
Note, you can define multiple ActionTargets on an Action.
C# Example:
|
|
ActionCategory |
Defines the action's category in the Action Browser. Use either the built-in ActionCategory enum or a string value to define a custom category.
C# Example:
[ActionCategory(ActionCategory.Animation)] public class MyAnimationAction : FsmStateAction [ActionCategory("Custom")] public class MyCustomAction : FsmStateAction |
|
Tooltip |
Defines rollover hints. Use on a class or any public field.
C# Example:
[Tooltip("This is the best action ever!")] public class MyCustomAction : FsmStateAction |
|
HelpUrl |
Defines a url to use for the help button next to the action title.
C# Example:
[HelpUrl("http://hutonggames.com/playmakerforum/index.php?topic=1711.0")] public class ConvertSecondsToString : FsmStateAction ... |
|
Note |
Display a Note for extra information about the action.
C# Example:
|
|
RequiredField |
Use on any public field that the user must define. If left undefined the editor will show an error.
C# Example:
[RequiredField] public FsmBool importantOption; |
|
Title |
Defines a new display name for an action field in the editor.
C# Example:
|
|
CheckForComponent |
Use on a public GameObject, FsmGameObject or FsmOwnerDefault field to check that the specified game object has the required components. Otherwise an error will show under the field. NOTE, you can specify up to 3 component types to check for.
C# Example:
[CheckForComponent(typeof(Animation))] public FsmGameObject gameObjectToAnimate; |
|
HasFloatSlider |
Use on a public float field to show a slider. Note: You specify min/max values for the slider, but you can still enter values outside that range in the edit field. This is by design...
C# Example:
[HasFloatSlider(0, 100)] public FsmFloat health; |
|
ArrayEditor |
Use this attribute to show an appropriate editor for an FsmArray variable.
C# Example:
[ArrayEditor(VariableType.GameObject)] public FsmArray gameObjects;
Optional parameters let you customize the editor further:
|
|
ActionSection | Use on a public field to create a bold section label to organize the UI better. | |
UIHint |
Use on a public field to help Playmaker show the most appropriate editor for the type of data. See the table below for details. |
|
ObjectType |
Use on a public field to define FsmEnum and FsmObject types
[ObjectType(typeof(LightType))] public FsmEnum lightType;
|
UIHint
Use a UIHint attribute on a public field to help Playmaker show the most appropriate editor for the type of data.
Hint | Description |
---|---|
Animation | Use on a string field for an animation browser button. |
Behaviour | Use on a string field for a Behavior popup button. The popup will attempt to find behaviors on the previously specified game object. |
Coroutine | Use on a string field for a Coroutine popup button. The popup will attempt to find Coroutine methods on the previously specified game object. |
Description | Use on a string field to format the text in a large readonly info box. |
Layer | Use on an integer field for a Layer popup button. |
Script | Use on a string field for a script popup button. The popup will attempt to find scripts on the previously specified game object. |
Tag | Use on a string field for a Tag popup button. |
TextArea | Use on a string field for a larger text edit field. |
Variable |
Use on an Fsm Variable field (FsmFloat, FsmInt, FsmBool...) to show a variable popup button used to select a variable of that type. |