Playmaker Forum

PlayMaker News => General Discussion => Topic started by: Unisonkid on November 28, 2015, 11:36:10 PM

Title: Need Action for Unity UI
Post by: Unisonkid on November 28, 2015, 11:36:10 PM
Hello All. I was wondering if there was anyone who could write an action to do an OnCancel like the OnClick button action for the Unity UI. From what I know there is a submit, cancel, etc. in the event trigger. I'm looking for an action that does what the cancel function does like in the event trigger component. Thanks in advance
Title: Re: Need Action for Unity UI
Post by: jeanfabre on November 30, 2015, 06:07:15 AM
Hi,

 the cancel is carried over as a boolean flag in the event data of the onEndEdit event.

so drop a PlayMakerUGuiComponentProxy, use the "On End Edit" event and then when you catch it in your fsm, use "GetEventData" and the boolean value, it will be true if the inputField "wasCanceled":

http://docs.unity3d.com/ScriptReference/UI.InputField-wasCanceled.html

Bye,

 Jean