Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: kidwithacomputer on January 08, 2015, 07:28:35 PM

Title: Can I detect a Click or Hover event on a uGui slider? [SOLVED] (kinda)
Post by: kidwithacomputer on January 08, 2015, 07:28:35 PM
Hi, with the Playmaker Ugui Component Proxy on a slider, is it possible to detect a click or other event besides On Value Changed? I'd like to detect a click, hover, or mouse up to play and stop a sound when someone interacts with the slider. I'm not too script savvy and am having some trouble figuring out if it's even possible. Any help is appreciated, thanks. :)
Title: Re: Can I detect a Click or Hover event on a UGui slider?
Post by: wheretheidivides on January 09, 2015, 01:58:28 AM
Yeah, use the ui actions for ui button click (one is messed up and 1 was fixed). Use the 'ugui button on click event' as 'ugui button event' doesn't work properly..  This is for a button click.  I don't thing they made actions for the others yet.  You may have to download it from this site somewhere if it's not in the ecosystem.

The easiest way is to get Master sound from the asset store.  It'll play sound when you hover, click and so forth.  You set it up and it does the rest.  No coding.
https://www.assetstore.unity3d.com/en/#!/content/5607
Title: Re: Can I detect a Click or Hover event on a UGui slider?
Post by: kidwithacomputer on January 09, 2015, 10:20:58 AM
I really appreciate the help, thank you! I'll try out Master Audio. Looks like it'll be a big help for my project.

Regarding the uGui actions, I'm having a hard time finding them. The uGui components I've been using I found at the following link, but they don't seem to include actions like you've shown, just proxy scripts: https://hutonggames.fogbugz.com/default.asp?W1192 - I've searched elsewhere on the forum and Google to no avail.

It's entirely possible that I'm just missing something. Still fumbling my way through a lot of this. If you know how I might locate the uGui actions like you've shown, I'd be very grateful.

Thank you again.
Title: Re: Can I detect a Click or Hover event on a UGui slider?
Post by: kidwithacomputer on January 09, 2015, 11:13:48 AM
I found them! http://hutonggames.com/playmakerforum/index.php?topic=8452.0
Title: Re: Can I detect a Click or Hover event on a UGui slider?
Post by: kidwithacomputer on January 09, 2015, 11:16:57 AM
Looks like 'UGui Button On Click Event' won't work on a slider. Requires UI.Button Component, it says.  :-\
Title: Re: Can I detect a Click or Hover event on a UGui slider?
Post by: kidwithacomputer on January 09, 2015, 11:52:00 AM
I just realized I can disable the 'uGui Image (Script)' on the slider handle, then make any custom game object a child of the handle, so now I can detect and apply any old playmaker action to that. This is real good because I wanted to use iTween animations on the slider handle too. After a couple days of messing with this I'm a little surprised at how simple the fix is, but it's even better than I expected because it gives me lots more control than I was hoping for.
Title: Re: Can I detect a Click or Hover event on a uGui slider? [SOLVED] (kinda)
Post by: wheretheidivides on January 10, 2015, 01:41:23 AM
Ugui thread
http://hutonggames.com/playmakerforum/index.php?topic=8452.0;topicseen