Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: tropical on February 17, 2016, 06:54:17 AM

Title: Specify Type of FsmArray in Custom Action [SOLVED]
Post by: tropical on February 17, 2016, 06:54:17 AM
Hi,

I try to use an FsmArray variable (Playmaker 1.8+) containing Ints in a custom action. How can I specify the type?
If I use [ArrayEditorAttribute(typeof(int))] or [ArrayEditorAttribute(typeof(FsmInt))] the action does not accept array variables of type 'Int' but only of type 'Object -> Int32' or 'Object -> FsmInt'.
Maybe the solution is too simple and I just don't see it...?
Can anyone help?

Thanks.
Title: Re: Specify Type of FsmArray in Custom Action
Post by: Alex Chouls on February 17, 2016, 04:41:36 PM
Use the ArrayEditorAttribute with a VariableType. Example:

Code: [Select]
[ArrayEditor(VariableType.GameObject)]
public FsmArray gameObjects;

VariableType values are Float, Int, Bool etc. Code completion should help you find the type you want.

I'll add some documentation to the wiki...
Title: Re: Specify Type of FsmArray in Custom Action
Post by: tropical on February 17, 2016, 06:10:40 PM
Use the ArrayEditorAttribute with a VariableType. Example:

Code: [Select]
[ArrayEditor(VariableType.GameObject)]
public FsmArray gameObjects;

VariableType values are Float, Int, Bool etc. Code completion should help you find the type you want.

I'll add some documentation to the wiki...

Thanks, Alex!
I'll try that.