private float CoefficientField(float value, float useValue, bool enabled, DrawMode mode)
{
GUIContent modeString = this.GetModeString(mode);
using (new EditorGUI.DisabledScope(!enabled))
{
GUILayout.BeginHorizontal(new GUILayoutOption[0]);
EditorGUI.showMixedValue = useValue < 0f;
EditorGUI.BeginChangeCheck();
useValue = !EditorGUILayout.Toggle(GUIContent.none, useValue != 0f, new GUILayoutOption[0]) ? ((float) 0) : ((float) 1);
if (EditorGUI.EndChangeCheck())
{
if (useValue > 0f)
{
value = 0f;
}
else
{
value = float.MaxValue;
}
this.drawMode = mode;
}
GUILayout.Space(-152f);
EditorGUI.showMixedValue = false;
using (new EditorGUI.DisabledScope(useValue != 1f))
{
float num = value;
EditorGUI.showMixedValue = value < 0f;
EditorGUI.BeginChangeCheck();
int keyboardControl = GUIUtility.keyboardControl;
if (useValue > 0f)
{
num = EditorGUILayout.FloatField(modeString, value, new GUILayoutOption[0]);
}
else
{
EditorGUILayout.FloatField(modeString, 0f, new GUILayoutOption[0]);
}
bool flag = EditorGUI.EndChangeCheck();
if (flag)
{
value = num;
if (value < 0f)
{
value = 0f;
}
}
if (flag || (keyboardControl != GUIUtility.keyboardControl))
{
this.drawMode = mode;
}
}
}
if (useValue > 0f)
{
float num3 = this.m_MinVisualizedValue[(int) mode];
float num4 = this.m_MaxVisualizedValue[(int) mode];
if ((num4 - num3) > 0f)
{
this.DrawColorBox(null, this.GetGradientColor((value - num3) / (num4 - num3)));
}
else
{
this.DrawColorBox(null, this.GetGradientColor((value > num3) ? ((float) 1) : ((float) 0)));
}
}
else
{
this.DrawColorBox(null, Color.black);
}
EditorGUI.showMixedValue = false;
GUILayout.EndHorizontal();
return value;
}