Quantcast
Channel: Latest Questions by Himani_123
Viewing all articles
Browse latest Browse all 54

how to set the background image on slider

$
0
0
how can i set the backgroung image on slider..? or can i change attach material to slider and can change it on click..?? if the value of slider variable ==1 can set image 1, and if value of slider variable==2 can set image 2 on slider..is it possible,..?? i hace done this till now.,it is changing image but on click it again not cnaginh back to previous image. public GUISkin myskin; private float sliderValue = 1.0f; private float maxSliderValue = 2.0f; public GUIStyle mystyle; public GUIStyle mystyle1; void OnGUI(){ GUI.skin=myskin; GUILayout.BeginVertical (); GUILayout.Box ("sliderValue : " + Mathf.RoundToInt(sliderValue)); sliderValue = GUI.HorizontalSlider(new Rect(10,50,200,50),sliderValue ,1.0f, maxSliderValue,mystyle1,mystyle1); if (sliderValue == 1) { sliderValue = GUI.HorizontalSlider(new Rect(10,50,200,50),sliderValue ,1.0f, maxSliderValue,mystyle,mystyle); }

Viewing all articles
Browse latest Browse all 54

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>