Skip to Content
Mastering UI Development with Unity
book

Mastering UI Development with Unity

by Dr. Ashley Godbold
April 2018
Beginner content levelBeginner
468 pages
11h 7m
English
Packt Publishing
Content preview from Mastering UI Development with Unity

Slider default event – On Value Changed (Single)

The Slider component's default event is the On Value Changed event, as seen in the On Value Changed (Single) section of the Slider component. This event will trigger whenever the Slider's Handle is moved. It can accept a float argument.

If you want the Slider's value to be sent as an argument to a function that has a parameter, you must select the function from the Dynamic float list (similar to selecting functions from the Toggle's Dynamic bool list).

The following functions and image represent a Slider example found in the Chapter7Text scene that triggers events that call functions with and without parameters:

public void SliderWithoutParameter(){    Debug.Log("changed");} public void SliderWithParameter(float ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Game Development with Unity for .NET Developers

Game Development with Unity for .NET Developers

Jiadong Chen
Unity UI Cookbook

Unity UI Cookbook

Francesco Sapio

Publisher Resources

ISBN: 9781787125520Supplemental Content