ParticleSystemCurveEditor.PresetCurveButtons C# (CSharp) Method

PresetCurveButtons() private method

private PresetCurveButtons ( Rect position, Rect curveEditorRect ) : void
position Rect
curveEditorRect Rect
return void
    private void PresetCurveButtons(Rect position, Rect curveEditorRect)
    {
        if (this.m_CurveEditor.animationCurves.Length != 0)
        {
            this.InitDoubleCurvePresets();
            if (this.m_DoubleCurvePresets != null)
            {
                DoubleCurvePresetLibrary currentLib = this.m_DoubleCurvePresets.GetPresetLibraryEditor().GetCurrentLib();
                int a = (currentLib == null) ? 0 : currentLib.Count();
                int num2 = Mathf.Min(a, 9);
                float width = 30f;
                float height = 15f;
                float num5 = 10f;
                float num6 = (num2 * width) + ((num2 - 1) * num5);
                float num7 = (position.width - num6) * 0.5f;
                float y = (position.height - height) * 0.5f;
                float x = 3f;
                if (num7 > 0f)
                {
                    x = num7;
                }
                this.PresetDropDown(new Rect((x - 20f) + position.x, y + position.y, 16f, 16f));
                GUI.BeginGroup(position);
                Color.white.a *= 0.6f;
                for (int i = 0; i < num2; i++)
                {
                    if (i > 0)
                    {
                        x += num5;
                    }
                    Rect rect = new Rect(x, y, width, height);
                    s_Styles.presetTooltip.tooltip = currentLib.GetName(i);
                    if (GUI.Button(rect, s_Styles.presetTooltip, GUIStyle.none))
                    {
                        DoubleCurve preset = currentLib.GetPreset(i) as DoubleCurve;
                        if (preset != null)
                        {
                            this.SetTopMostCurve(preset);
                            this.m_CurveEditor.ClearSelection();
                        }
                    }
                    if (Event.current.type == EventType.Repaint)
                    {
                        currentLib.Draw(rect, i);
                    }
                    x += width;
                }
                GUI.EndGroup();
            }
        }
    }