Hi
i searched the forum and echosystem for this.
is there a simple way to store the last button which generated an event via this action :
too bad this action does not have an additional param which would be "button script carrier" and we could store that in a gameobject variable.
in a state i have several stacked actions monitoring several buttons.
i was thinking about 3 ways to accomplish this but both feels overkill for me.
also each of these seems kinda viable if you just have 2 up to 5 buttons, but if you have way more buttons all look very complex to handle a simple problem.
1) on each of the buttons monitored : put an FSM-event call in OnClick() in the inspector. Call another FSM which has only one role : catch with a global transition event which button of the pool of buttons was the last pressed.
2) the simple stupid one : put a different event on EACH of the stacked actions, and save the clicked button in a global variable before doing anything else.
the problem is that this solution looks ugly to me. it visually pollutes the FSM.
3) -Does not work-
Right above each 'U Gui Button On Click' of my stack : put a "set gameobject" and store the button from the action right under in a variable (same variable for all onclick's).
given that the state will exit via one of the OnClick's it means that it will not execute the gameobject assignation lower than the actual button which was just pressed. As a result the variable would have the last pressed button saved.
Any suggestions to handle this the most clean and easily maintenable way ?
thanks.