Playmaker Forum

PlayMaker Help & Tips => iOS Help => Topic started by: dubnug on March 01, 2013, 09:18:34 PM

Title: Link to NGUI Horizontal Slider OR Make Unity GUI slider invisible?
Post by: dubnug on March 01, 2013, 09:18:34 PM
Hey guys,

So I've seen the documentation on linking NGUI components with Unity and searched through the forums, but can't find any info specific to NGUI Horizontal Sliders. I'm pretty new to both platforms admittedly.

So I have a widget containing a slider, created through NGUI with my own atlas, etc. But through Unity, the animations I'm trying to control with the slider just go automatically when I press play, unless I have it linked to the GUI Slider action provided in Unity.

So, does anyone know how to link it up directly through the GUI?

OR..

I've realized I can just position the NGUI slider in the same exact position as a standard GUI Slider linked up through Playmaker. I've tried deleting the thumb/slider styles but it still displays. Can I make this invisible or move it behind the NGUI components?

Thanks so much for the help so far! These forums are making sure I meet my school deadlines for my project  ;D
Title: Re: Link to NGUI Horizontal Slider OR Make Unity GUI slider invisible?
Post by: aarongodde on March 11, 2013, 06:22:19 PM
I've done a similar thing but with buttons, not sliders.

On the button I had to add the UIEventToPlaymaker script which registers any button presses and broadcasts that information to any FSM attached to the button. My FSM attached to that button has an 'OnClick' event which registers the button click and runs the actions I want the button to execute.

I know a slider is not a button but maybe it might work in a similar fashion.
Title: Re: Link to NGUI Horizontal Slider OR Make Unity GUI slider invisible?
Post by: aarongodde on March 11, 2013, 09:55:06 PM
Oooops.

Here is the link to that UIEventToPlayMakerFSM script.

http://hutonggames.com/playmakerforum/index.php?topic=1356.0

I thought it came standard with Playmaker but it doesn't. Download this, place it in your Assets folder then attach it to each button in your NGUI. It sends an event which PlayMaker can then grab.
Title: Re: Link to NGUI Horizontal Slider OR Make Unity GUI slider invisible?
Post by: jerware on March 16, 2013, 02:31:04 AM
I don't think that script will work on anything but buttons, but I could be wrong. OP, have you tried using a Get Property action to poll a property of the slider on every frame? Get Property can be a little weird to get used to, since you need to link it to a component, not a GameObject, but that's what I would try first.
Title: Re: Link to NGUI Horizontal Slider OR Make Unity GUI slider invisible?
Post by: jeanfabre on May 20, 2013, 02:21:40 AM
Hi,

 I am in the process of creating a full set of custom actions, proxies and custom widgets for Ngui port to Playmaker, so this is the right opportunity to start somehow.

 I have added the slider change callback on the events proxy forwarder, so go download it here:

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

the name has changed ( in prevision of a lot more work and also to properly identify that this is related to Ngui).

 Also, don't forget to properly set the ngui slider component itself with the "event receiver" to target the gameObject ( likely itslef) where this proxy will be located, else nothing will be fired.

bye,

 Jean