- Home /
The question is answered, right answer was accepted
Playmaker and new UI
I have downloaded the Unity 4.6 beta with the new UI. I have Playmaker, and I want to know how to interact with the new UI. For example, I create a button from Unity, I add a state machine to it, and I want to catch the click button. Can I do that?
Answer by Kiwasi · Nov 08, 2014 at 12:30 AM
Yes.
Create a new event listener on the OnClick. (click the little plus button)
Drag the GameObject with the state machine onto the slot
Select the appropriate function from the drop down list
You can only select functions that are public, have a return type of void, and take no arguments or a single argument of a select few types. See the documentation for details.
If the playmaker state machine does not have an appropriate method you may need to write your own.
How about if I want to set the value of a global variable in FS$$anonymous$$?
The Play$$anonymous$$aker reference is difficult to follow on this (I don't use playmaker myself). It looks like you need to define a method that will set your variable.
public void SetGlobalVariable (){
// Code to set the variable here
}
No doubt playmaker will come out with a better way to do it soon. You might want to contact them or check their forums. I'm sure they have hundreds of people wanting to interact with the UI that can't write a script of any description.
Follow this Question
Related Questions
How to click on button that is behind transparent image in New UI? 2 Answers
Making a GUI element follow the cursor without delay. 2 Answers
How to fix the world space canvas not showing in game 0 Answers
New UI: How to change depth/order from script? 4 Answers
Canvas Graphics raycaster, prevent 2d and 3d physic raycast 0 Answers