private static void DrawImageBasedCap(int controlID, Vector3 position, Quaternion rotation, float size, GUIStyle normal, GUIStyle active)
{
if ((Camera.current == null) || (Vector3.Dot(position - Camera.current.transform.position, Camera.current.transform.forward) >= 0f))
{
Vector3 vector = (Vector3) HandleUtility.WorldToGUIPoint(position);
Handles.BeginGUI();
float fixedWidth = normal.fixedWidth;
float fixedHeight = normal.fixedHeight;
Rect rect = new Rect(vector.x - (fixedWidth / 2f), vector.y - (fixedHeight / 2f), fixedWidth, fixedHeight);
if (GUIUtility.hotControl == controlID)
{
active.Draw(rect, GUIContent.none, controlID);
}
else
{
normal.Draw(rect, GUIContent.none, controlID);
}
Handles.EndGUI();
}
}