playMaker

Author Topic: Specify Type of FsmArray in Custom Action [SOLVED]  (Read 1067 times)

tropical

  • Playmaker Newbie
  • *
  • Posts: 16
    • View Profile
Specify Type of FsmArray in Custom Action [SOLVED]
« on: February 17, 2016, 04: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.
« Last Edit: February 18, 2016, 12:34:46 PM by Alex Chouls »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3201
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: Specify Type of FsmArray in Custom Action
« Reply #1 on: February 17, 2016, 02: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...

tropical

  • Playmaker Newbie
  • *
  • Posts: 16
    • View Profile
Re: Specify Type of FsmArray in Custom Action
« Reply #2 on: February 17, 2016, 04: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.