Case Status
Log In

Wiki

Options

 
Home ยป API Reference»Action Attributes
Index
Navigation
Community Wiki

Action Attributes

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:

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
[ActionTarget(typeof(AudioSource), "gameObject")]
[ActionTarget(typeof(AudioClip), "oneShotClip")]
public class AudioPlay : FsmStateAction
{
    public FsmOwnerDefault gameObject;		
    
    [ObjectType(typeof(AudioClip))]
    public FsmObject oneShotClip;

    ...
}

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:

1:
2:
3:
4:
5:
[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:

1:
2:
[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:

1:
2:
3:
[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:

1:
2:
3:
[Note("Warning, this action is super cool!")]
public class MyAction : FsmStateAction
...

RequiredField

Use on any public field that the user must define. If left undefined the editor will show an error.

 

C# Example:

1:
2:
[RequiredField]
public FsmBool importantOption;

Title
Defines a new display name for an action field in the editor.
 
C# Example:
1:
2:
[Title("Position")]
public FsmRect screenRect;
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:

1:
2:
[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:

1:
2:
[HasFloatSlider(0, 100)]
public FsmFloat health;

ArrayEditor

Use this attribute to show an appropriate editor for an FsmArray variable.

 

C# Example:

1:
2:
[ArrayEditor(VariableType.GameObject)]
public FsmArray gameObjects;

 

Optional parameters let you customize the editor further:

 

public ArrayEditorAttribute(VariableType variableType, string elementName = "", int fixedSize = 0, int minSize = 0, int maxSize = 65536)

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

1:
2:
[ObjectType(typeof(LightType))]
public FsmEnum lightType;

 

1:
2:
[ObjectType(typeof(MonoBehaviour))]
public FsmObject behaviour;

 

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.
 

 


Last modified on 4/26/2016 3:37 AM by User.

  • RSS Feed