Search Unity

Problem with sliders in Unity 3

Discussion in 'Immediate Mode GUI (IMGUI)' started by illogikaStudios, Nov 5, 2010.

  1. illogikaStudios

    illogikaStudios

    Joined:
    Nov 19, 2008
    Posts:
    66
    Hi,

    I recently ran into a problem with customizing sliders in Unity 3. When I want to set a different thumb image in a GUIStyle, the thumb image won't show up, even if the slider's thumb position gets updated if I click on it. I used to do this without problem in Unity 2.6. I submitted a bug but I wanted to know if anyone else had this problem and/or if you know a workaround.

    I simply changed the normal and active images in the thumb style as well as the normal image in the slider style.

    Code (csharp):
    1.  
    2. var mySliderStyle : GUIStyle;
    3. var myThumbStyle : GUIStyle;
    4.  
    5. private var playSliderPos : float;
    6.  
    7. function OnGUI () {
    8.     playSliderPos = GUILayout.HorizontalSlider (playSliderPos, 0.0, 1.0, mySliderStyle, myThumbStyle, GUILayout.Width(100) );
    9. }
    10.