playMaker

Author Topic: FsmEventTarget, enum EventTarget { root, parent }  (Read 2852 times)

Andy22

  • Junior Playmaker
  • **
  • Posts: 99
FsmEventTarget, enum EventTarget { root, parent }
« on: August 21, 2013, 08:29:52 AM »
Hi,

i know i can use variables + getRoot/Parent, but those are common operations and having the root/parent directly inside the enum would be nice.

thx Andy

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: FsmEventTarget, enum EventTarget { root, parent }
« Reply #1 on: August 24, 2013, 04:23:51 AM »
Hi,

 Yes, I would love that too!

We should have get parent AND get root, parent being the direct parent, and root being the top most parent of the hierarchy.

bye,

Jean

Andy22

  • Junior Playmaker
  • **
  • Posts: 99
Re: FsmEventTarget, enum EventTarget { root, parent }
« Reply #2 on: August 24, 2013, 06:42:56 AM »
Yep, the way unity handles serialization often forces me to use a gameobject + monobehaviour, so we end up with some hierarchy of gameobjects that function together.

In many cases this hierarchy is kinda "loose" means most special setup is done on the root object and several subobjects add functionality. I did setup common operation this way that if i look for a FSM or component i first look on the same gameobject, than the parent and finally the root, if this fails i look from root inside all childs.

This logic works so far and i don't need to setup special references for my common behaviors.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: FsmEventTarget, enum EventTarget { root, parent }
« Reply #3 on: August 25, 2013, 02:53:41 PM »
I agree this would be useful. I'll look into it...

SendMessageUpwards might also be useful in these situations.