public static void MinMaxScroller(Rect position, int id, ref float value, ref float size, float visualStart, float visualEnd, float startLimit, float endLimit, GUIStyle slider, GUIStyle thumb, GUIStyle leftButton, GUIStyle rightButton, bool horiz)
{
float num;
Rect rect;
Rect rect2;
Rect rect3;
if (horiz)
{
num = (size * 10f) / position.width;
}
else
{
num = (size * 10f) / position.height;
}
if (horiz)
{
rect = new Rect(position.x + leftButton.fixedWidth, position.y, (position.width - leftButton.fixedWidth) - rightButton.fixedWidth, position.height);
rect2 = new Rect(position.x, position.y, leftButton.fixedWidth, position.height);
rect3 = new Rect(position.xMax - rightButton.fixedWidth, position.y, rightButton.fixedWidth, position.height);
}
else
{
rect = new Rect(position.x, position.y + leftButton.fixedHeight, position.width, (position.height - leftButton.fixedHeight) - rightButton.fixedHeight);
rect2 = new Rect(position.x, position.y, position.width, leftButton.fixedHeight);
rect3 = new Rect(position.x, position.yMax - rightButton.fixedHeight, position.width, rightButton.fixedHeight);
}
float num2 = Mathf.Min(visualStart, value);
float num3 = Mathf.Max(visualEnd, value + size);
MinMaxSlider(rect, ref value, ref size, num2, num3, num2, num3, slider, thumb, horiz);
bool flag = false;
if (Event.current.type == EventType.MouseUp)
{
flag = true;
}
if (ScrollerRepeatButton(id, rect2, leftButton))
{
value -= num * ((visualStart >= visualEnd) ? -1f : 1f);
}
if (ScrollerRepeatButton(id, rect3, rightButton))
{
value += num * ((visualStart >= visualEnd) ? -1f : 1f);
}
if (flag && (Event.current.type == EventType.Used))
{
scrollControlID = 0;
}
if (startLimit < endLimit)
{
value = Mathf.Clamp(value, startLimit, endLimit - size);
}
else
{
value = Mathf.Clamp(value, endLimit, startLimit - size);
}
}