playMaker

Author Topic: Custom Types (default unity behavior)  (Read 2718 times)

koen.pis

  • Playmaker Newbie
  • *
  • Posts: 11
    • View Profile
Custom Types (default unity behavior)
« on: April 12, 2011, 03: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: April 13, 2011, 05:08:11 AM by koen.pis »

tobbeo

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 186
    • View Profile
Re: Custom Types in Custom Events (default unity behavior)
« Reply #1 on: April 12, 2011, 04: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
    • View Profile
Re: Custom Types in Custom Events (default unity behavior)
« Reply #2 on: April 13, 2011, 01: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, 02:45:09 AM by koen.pis »

MaDDoX

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 165
    • View Profile
    • FluidPlay Studios
Re: Custom Types (default unity behavior)
« Reply #3 on: April 13, 2011, 06: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
    • View Profile
Re: Custom Types (default unity behavior)
« Reply #4 on: April 13, 2011, 07: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, 07:42:56 AM by koen.pis »