playMaker

Author Topic: Link to NGUI Horizontal Slider OR Make Unity GUI slider invisible?  (Read 5518 times)

dubnug

  • Playmaker Newbie
  • *
  • Posts: 22
    • View Profile
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

aarongodde

  • Playmaker Newbie
  • *
  • Posts: 3
    • View Profile
Re: Link to NGUI Horizontal Slider OR Make Unity GUI slider invisible?
« Reply #1 on: March 11, 2013, 03: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.

aarongodde

  • Playmaker Newbie
  • *
  • Posts: 3
    • View Profile
Re: Link to NGUI Horizontal Slider OR Make Unity GUI slider invisible?
« Reply #2 on: March 11, 2013, 06: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.

jerware

  • Playmaker Newbie
  • *
  • Posts: 23
    • View Profile
Re: Link to NGUI Horizontal Slider OR Make Unity GUI slider invisible?
« Reply #3 on: March 15, 2013, 11:31:04 PM »
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.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15318
  • Official Playmaker Support
    • View Profile
Re: Link to NGUI Horizontal Slider OR Make Unity GUI slider invisible?
« Reply #4 on: May 19, 2013, 11:21:40 PM »
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