private int GetTabAtMousePos(Vector2 mousePos, Rect position) { return (int) Mathf.Min((float) ((mousePos.x - position.xMin) / this.GetTabWidth(position.width)), (float) 100f); }