In Unity 3 beta 7 I’m trying to style a horizonal slider thumb and can’t seem to get the content offset to work. Neither in the GUI nor in the code:
using UnityEngine;
using System.Collections;
public class GUIMenu : MonoBehaviour {
public GUIStyle horizontalSlider;
public GUIStyle horizontalSliderThumb;
float hSliderValue = 1.0f;
void OnGUI() {
Vector2 offset = horizontalSliderThumb.contentOffset;
offset.x = 50.0f;
offset.y = 50.0f;
horizontalSliderThumb.contentOffset = offset;
Rect slider = new Rect (50, 30, 214, 30);
hSliderValue = GUI.HorizontalSlider(slider,hSliderValue,1.0f,100.0f,horizontalSlider,horizontalSliderThumb);
}
}
Am I missing something?