public void OnSceneGUI()
{
bool flag = GUIUtility.hotControl == this.m_HandleControlID;
CapsuleCollider target = (CapsuleCollider)this.target;
Color color = Handles.color;
Handles.color = !target.enabled ? Handles.s_ColliderHandleColorDisabled : Handles.s_ColliderHandleColor;
bool enabled = GUI.enabled;
if (!this.editingCollider && !flag)
{
GUI.enabled = false;
Handles.color = new Color(1f, 0.0f, 0.0f, 1f / 1000f);
}
Vector3 capsuleExtents = ColliderUtil.GetCapsuleExtents(target);
float num1 = capsuleExtents.y + 2f * capsuleExtents.x;
float x = capsuleExtents.x;
Matrix4x4 capsuleTransform = ColliderUtil.CalculateCapsuleTransform(target);
int hotControl = GUIUtility.hotControl;
float height = target.height;
Vector3 localPos = Vector3.left * num1 * 0.5f;
float num2 = CapsuleColliderEditor.SizeHandle(localPos, Vector3.left, capsuleTransform, true);
if (!GUI.changed)
{
num2 = CapsuleColliderEditor.SizeHandle(-localPos, Vector3.right, capsuleTransform, true);
}
if (GUI.changed)
{
float num3 = num1 / target.height;
height += num2 / num3;
}
float radius = target.radius;
float num4 = CapsuleColliderEditor.SizeHandle(Vector3.forward * x, Vector3.forward, capsuleTransform, true);
if (!GUI.changed)
{
num4 = CapsuleColliderEditor.SizeHandle(-Vector3.forward * x, -Vector3.forward, capsuleTransform, true);
}
if (!GUI.changed)
{
num4 = CapsuleColliderEditor.SizeHandle(Vector3.up * x, Vector3.up, capsuleTransform, true);
}
if (!GUI.changed)
{
num4 = CapsuleColliderEditor.SizeHandle(-Vector3.up * x, -Vector3.up, capsuleTransform, true);
}
if (GUI.changed)
{
float num3 = Mathf.Max(capsuleExtents.z / target.radius, capsuleExtents.x / target.radius);
radius += num4 / num3;
}
if (hotControl != GUIUtility.hotControl && GUIUtility.hotControl != 0)
{
this.m_HandleControlID = GUIUtility.hotControl;
}
if (GUI.changed)
{
Undo.RecordObject((Object)target, "Modify Capsule Collider");
target.radius = Mathf.Max(radius, 1E-05f);
target.height = Mathf.Max(height, 1E-05f);
}
Handles.color = color;
GUI.enabled = enabled;
}