Beispiel #1
0
    public static Rect DrawHorizontalSliderThumb(Rect rect, float position)
    {
        rect        = SGT_RectHelper.RemoveRightPx(rect, 8.0f);
        rect.xMin  += rect.width * position;
        rect.width  = 16.0f;
        rect.height = 16.0f;

        GUI.Box(rect, string.Empty, GUI.skin.horizontalSliderThumb);

        return(rect);
    }
Beispiel #2
0
    public static float GetHorizontalSliderAcross(Rect rect, float x)
    {
        rect = SGT_RectHelper.RemoveRightPx(rect, 8.0f);

        return(Mathf.Clamp01((x - rect.x - 4.0f) / rect.width));
    }