public void OnGUI(Rect rect)
{
this.Init();
if (s_Styles == null)
{
s_Styles = new Styles();
}
Rect position = new Rect(rect.x, rect.y, rect.width, rect.height - 30f);
Rect rect3 = new Rect(rect.x, rect.y + position.height, rect.width, 30f);
GUI.Label(position, GUIContent.none, s_Styles.curveEditorBackground);
if (Event.current.type == EventType.Repaint)
{
this.m_CurveEditor.rect = position;
}
foreach (CurveWrapper wrapper in this.m_CurveEditor.animationCurves)
{
if ((wrapper.getAxisUiScalarsCallback != null) && (wrapper.setAxisUiScalarsCallback != null))
{
Vector2 newAxisScalars = wrapper.getAxisUiScalarsCallback();
if (newAxisScalars.y > 1000000f)
{
newAxisScalars.y = 1000000f;
wrapper.setAxisUiScalarsCallback(newAxisScalars);
}
}
}
this.m_CurveEditor.OnGUI();
this.DoLabelForTopMostCurve(new Rect(rect.x + 4f, rect.y, rect.width, 20f));
this.DoRemoveSelectedButton(new Rect(position.x, position.y, position.width, 24f));
this.DoOptimizeCurveButton(rect3);
rect3.x += 30f;
rect3.width -= 60f;
this.PresetCurveButtons(rect3, rect);
this.SaveChangedCurves();
}