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.