playMaker

Author Topic: Getting Component of FSM  (Read 808 times)

Zoom

  • Playmaker Newbie
  • *
  • Posts: 2
Getting Component of FSM
« on: January 06, 2020, 12:37:10 PM »
Hi All,

My first post! I am new to Playmaker but find it very interesting and useful, thanks to the devs for creating this. It really feels like it is a lot easier to sit down and work as some tasks can be completed just by a couple of clicks on the mouse.

Now to my problem... I have a gameobject with an FSM attached. The FSM only includes one state "Start -> Default". On the "State" panel I have added a GUI Button. I would like to create a script that can modify the picture of this GUI Button.

I would like to accomplish the mix of utilizing scripts + Playmaker as much as possible. I have some other scripts doing some random stuff with the FSMs but could not find a way to find the GUI Button component of the FSM, can this be accomplished?

Been searching all day but no luck, can anyone help?
This is what I have so far.

            foreach (GameObject child in childObjects) //all FSMs in childObjects
            {
                getFSM = child.gameObject.GetComponent<PlayMakerFSM>();
                foreach (FsmState f in getFSM.FsmStates) //checking FSM state
                {
                    Debug.Log(f.Name);         
                    GameObject go = f.GetComponent<Button>(); //<- not working syntax but what I am looking for
                }
            }

The syntax above is just some tests and to give you a general idea of what I am looking for.

Zoom

  • Playmaker Newbie
  • *
  • Posts: 2
Re: Getting Component of FSM
« Reply #1 on: January 06, 2020, 03:26:54 PM »
Ok, I just realized that the GUIButtons are not up to date  :-X Will need to plan everything for the canvas :P Some extra work but maybe it is better this way  ;D