- Home /
I made a menu with NGUI and I would like to know how to give to an slider functionality
Answer by kmeboe · Oct 11, 2012 at 04:08 PM
You can create the slider by following this page: http://www.tasharen.com/?page_id=280
To hook up the slider, you will need to create a method inside one of your scripts that will receive notification when the slider changes. For instance, I have a slider that changes ambient lighting. Inside one of my scripts, I have the following method:
public void AdjustAmbientLighting(float factor)
{
...
}
When you receive the message, "factor" will be a number from 0 to 1.
To hook up the slider to this method, you will need to click on the slider in the inspector and drag the game object with the above method into the "Event Recv." field. You will also need to type the method name into the "Function" field; in my case I typed "AdjustAmbientLighting" (without the quotes).
Good luck, and let me know if you need clarification on anything.
Your answer
Follow this Question
Related Questions
A node in a childnode? 1 Answer
IS it possible to load the whole game (and all scenes) at startup to avoid scene change delay? 1 Answer
Loadlevel and buttons... 2 Answers
GUI circulur menu system 1 Answer
Horizontal Slider issue 0 Answers