playMaker

Author Topic: Custom Types (default unity behavior)[SOLVED]  (Read 8156 times)

koen.pis

  • Playmaker Newbie
  • *
  • Posts: 11
Custom Types (default unity behavior)[SOLVED]
« on: April 12, 2011, 06:45:34 PM »
I learned this funny trick in unity to organize variables in the inspector. But this trick does not work in playmaker actions.
Pictures say more then words in this case ...

In unity the following code gives (see code) ... the following result in the inspector (see picture)

Code: [Select]
[System.Serializable]
public class InitAction {
public ActionKey Key;
public ActionType Type;
public string Name;
public string Description;
public KeyCode[] PrimKeys;
public KeyCode[] SecKeys;
}



looks nice and clean ... so pretty plz  ;D
« Last Edit: July 25, 2018, 04:04:22 AM by jeanfabre »

tobbeo

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 186
Re: Custom Types in Custom Events (default unity behavior)
« Reply #1 on: April 12, 2011, 07:25:09 PM »
Hmm... you can expose your Playmaker variables in the inspector but you're saying it doesn't look clean enough? And of course the actions themselves and custom actions are laid out the way you displayed it.

koen.pis

  • Playmaker Newbie
  • *
  • Posts: 11
Re: Custom Types in Custom Events (default unity behavior)
« Reply #2 on: April 13, 2011, 04:12:10 AM »
No, I don't want the variables to show up in the inspector. I would like to organize the variables in the 'Playmaker Fsm Editor' the same way as I can in the 'unity inspector'. If I try to do this in the 'Playmaker Fsm Editor' atm, I get a error: unsupported type. My gues is that playmaker does not know how to display the serialized class.

Some of my (initializing) actions take in a allot of variables to set up the controls, object attributes, .... (think of a array with 10 to 20 of the above structures). Even with the new panels this still becomes a real mess. There are ways around it but I would prefer to open up the configuration in playmaker so our designers have one tool/window where they can tweak at will without messing around in other unity tibits (pre set defaults).
« Last Edit: April 13, 2011, 05:45:09 AM by koen.pis »

MaDDoX

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 165
    • FluidPlay Studios
Re: Custom Types (default unity behavior)
« Reply #3 on: April 13, 2011, 09:06:39 AM »
You mean grouping variables inside a class so you can collapse/expand it right? Cool and all, but I think there are more basic things to address first. For instance, maybe we could have a way to re-order the variables arbitrarily instead of just using the alphabetical order, and we don't even have arrays (collections) variables yet.
--
Breno "MaDDoX" Azevedo
@brenoazevedo

koen.pis

  • Playmaker Newbie
  • *
  • Posts: 11
Re: Custom Types (default unity behavior)
« Reply #4 on: April 13, 2011, 10:10:37 AM »
- Tbh sorting isn't rely needed in my book, the order of variables is controllable by changing there position in code and we can group them using '[ActionSection("A Section")]'. (in action, not Playmaker variables)

- We already have array's in actions and they act just like in unity's inspector. (try "public int[] test;")  As for collections, unity inspector doesn't support collections ether and there is a good reason for that. You should avoid using them.

- And yes I mean the collapsible structure. It's not just that it looks cleaner do, it's also the fact that you can make those custom types array's and that makes it allot more flexible. (no more preset size or amount) Link below is a small example showing how I have it in playmaker and in unity's inspector. Also note that I can change the size in unity, no way to do that in playmaker. I could have made all the variable types array's but that a big "NoNo". It would be impossible to know (100% sure) what string goes on to what key and so on.
(Click for image)


Sorry if first post coursed some confusion, hope this one clears the air a bit.
« Last Edit: April 13, 2011, 10:42:56 AM by koen.pis »

dev19872014

  • Playmaker Newbie
  • *
  • Posts: 20
Re: Custom Types (default unity behavior)
« Reply #5 on: May 26, 2018, 04:50:01 AM »
Any update on this?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Custom Types (default unity behavior)
« Reply #6 on: July 25, 2018, 04:04:07 AM »
Hi,

 you can do this in PlayMaker know,



Bye,

 Jean