private static void GUICurveField(Rect position, SerializedProperty maxCurve, SerializedProperty minCurve, Color color, Rect ranges, CurveFieldMouseDownCallback mouseDownCallback)
{
int controlID = GUIUtility.GetControlID(0x4ec1c30f, FocusType.Keyboard, position);
Event current = Event.current;
EventType typeForControl = current.GetTypeForControl(controlID);
if (typeForControl == EventType.Repaint)
{
Rect rect = position;
if (minCurve == null)
{
EditorGUIUtility.DrawCurveSwatch(rect, null, maxCurve, color, EditorGUI.kCurveBGColor, ranges);
}
else
{
EditorGUIUtility.DrawRegionSwatch(rect, maxCurve, minCurve, color, EditorGUI.kCurveBGColor, ranges);
}
EditorStyles.colorPickerBox.Draw(rect, GUIContent.none, controlID, false);
}
else if (typeForControl == EventType.ValidateCommand)
{
if (current.commandName == "UndoRedoPerformed")
{
AnimationCurvePreviewCache.ClearCache();
}
}
else if ((typeForControl == EventType.MouseDown) && (position.Contains(current.mousePosition) && ((mouseDownCallback != null) && mouseDownCallback(current.button, position, ranges))))
{
current.Use();
}
}