Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: kapitanpattimura on April 13, 2018, 02:45:30 PM
-
Hello, team
As the subject says, I would like to know how can I retrieve the list of FsmEvent(s) associated to the current FsmState.
Something similar to this but specific for the active state (this one lists ALL events associated to the FSM):
GameObject go = Fsm.GetOwnerDefaultTarget (gameObject);
fsm = go.GetComponentInChildren <PlayMakerFSM> ();
foreach (FsmEvent fsmEvent in fsm.Fsm.Events) {
Debug.Log ("fsmEvent = " + fsmEvent.Name);
}
Thanks a lot in advance,
José
-
FsmState has a Transitions property that is an array of FsmTransitions.
Each FsmTransition has an FsmEvent property, so if you can loop through the transitions to get them all.
-
Perfect, that is what I needed.
Thanks for the quick support, have a nice day!