playMaker

Author Topic: Trouble getting started with NGUI & playmaker [SOLVED]  (Read 3954 times)

bitbutter

  • Playmaker Newbie
  • *
  • Posts: 9
Trouble getting started with NGUI & playmaker [SOLVED]
« on: June 17, 2013, 11:52:20 AM »
I own NGUI and Playmaker, and have installed both packages in my project. I'm trying to follow the instructions on this page but I'm getting stuck:

https://hutonggames.fogbugz.com/default.asp?W1111

Quote
Drag the "NGUI PlayMaker Proxy" prefab into your scene. It will make available a set of global events "NGUI / XXX"

I've dragged the prefab to the root of my scene, but it's not clear to me where to check that the new set of global events has been added. Where should this new set appear exactly? (I don't see anything like this in the Event Browser window, for instance).

Quote
In your GameObject target where you want to listen to nGui events, add the "NGuiEventsToPlaymakerFsmEvents" script

Done.

Quote
Set the "NGuiEventsToPlaymakerFsmEvents" component to target the fsm of your choice ( it will pick the first one attached if it finds one)

It targeted the correct (only) one.

Quote
In the Fsm, add the ngui global event you want from the context menu.

How is this context menu accessed exactly? (right clicking on the background of the Events panel of this fsm gives an option to show the Event Browser, but this still doesn't look to contain any NGUI releted items).

Any help greatly appreciated!
Thanks.
« Last Edit: June 24, 2013, 06:01:41 AM by bitbutter »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Trouble getting started with NGUI & playmaker
« Reply #1 on: June 17, 2013, 01:50:22 PM »
Hi,

My bad... that will teach me ( yet again...) to not verify packages... Sorry about that.

 You can download the package again from the wiki, the global events will be there.

Also, I have added another package with examples. for now There is only one ( drop down menu), but I will add more in the coming days. the examples are documented, so make sure you read the fsm descriptions and the states description.

Tell me if that works better for you, it should :)

Bye,

 Jean

bitbutter

  • Playmaker Newbie
  • *
  • Posts: 9
Re: Trouble getting started with NGUI & playmaker
« Reply #2 on: June 18, 2013, 07:11:12 AM »
Thanks Jean, that gets me further! Nearly there.

Quote
Don't forget to also properly set up the nGui component that will fire these events. For example, if it is a slider, you need to set the "event receiver"

I have a NGUI button, for instance. And a FSM attached to an empty game object that I want to respond to the button presses. Where exactly should I be looking for the place to make this "event receiver" assignment? (on which object, which component?).

Quote
you need to set the "event receiver" to the gameObject where this proxy is located to receive the default "OnSliderChange" ngui function.

It's not clear to me what 'this proxy' refers to here. Could you clarify?

Thanks for your patience!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Trouble getting started with NGUI & playmaker
« Reply #3 on: June 19, 2013, 03:47:06 AM »
Hi,

 ok, UIButton do not have a event receiver system, it's actually simpler here.

I will take the "Tutorial 6" example from ngui to explain this.

1: Select the "Button" gameObject in the hierarchy
2: Add a "NGuiEventsToPlaymakerFsmEvents" component
3: add an fsm component to that "Button" gameObject,
4: in the fsm, add a global event "NGUI / ON CLICK", don't create that event, it's already there ( define in "NGUI PlayMaker Proxy" prefab


Run the scene, the fsm will receive the global event "NGUI / ON CLICK".


if you use a ui component that has an event receiver you need to target the gameObject where "NGuiEventsToPlaymakerFsmEvents" is located, that's all.



Does that help?

 I have attached the scene itself just to give you a working scene ( you need to have the ngui playmaker package of course).


bye,

 Jean

bitbutter

  • Playmaker Newbie
  • *
  • Posts: 9
Re: Trouble getting started with NGUI & playmaker
« Reply #4 on: June 24, 2013, 06:01:16 AM »
Great thanks!