UnityEditor.CurveEditorWindow.OnGUI C# (CSharp) Method

OnGUI() private method

private OnGUI ( ) : void
return void
        private void OnGUI()
        {
            bool flag = Event.current.type == EventType.MouseUp;
            if (this.delegateView == null)
            {
                this.m_Curve = null;
            }
            if (ms_Styles == null)
            {
                ms_Styles = new Styles();
            }
            this.m_CurveEditor.rect = this.GetCurveEditorRect();
            this.m_CurveEditor.hRangeLocked = Event.current.shift;
            this.m_CurveEditor.vRangeLocked = EditorGUI.actionKey;
            GUI.changed = false;
            GUI.Label(this.m_CurveEditor.drawRect, GUIContent.none, ms_Styles.curveEditorBackground);
            this.m_CurveEditor.OnGUI();
            GUI.Box(new Rect(0f, base.position.height - 46f, base.position.width, 46f), "", ms_Styles.curveSwatchArea);
            this.m_Color.a *= 0.6f;
            float y = (base.position.height - 46f) + 10.5f;
            this.InitCurvePresets();
            CurvePresetLibrary currentLib = this.m_CurvePresets.GetPresetLibraryEditor().GetCurrentLib();
            if (currentLib != null)
            {
                for (int i = 0; i < currentLib.Count(); i++)
                {
                    Rect position = new Rect(45f + (45f * i), y, 40f, 25f);
                    this.m_GUIContent.tooltip = currentLib.GetName(i);
                    if (GUI.Button(position, this.m_GUIContent, ms_Styles.curveSwatch))
                    {
                        AnimationCurve preset = currentLib.GetPreset(i) as AnimationCurve;
                        this.m_Curve.keys = preset.keys;
                        this.m_Curve.postWrapMode = preset.postWrapMode;
                        this.m_Curve.preWrapMode = preset.preWrapMode;
                        this.m_CurveEditor.SelectNone();
                        this.SendEvent("CurveChanged", true);
                    }
                    if (Event.current.type == EventType.Repaint)
                    {
                        currentLib.Draw(position, i);
                    }
                    if (position.xMax > (base.position.width - 90f))
                    {
                        break;
                    }
                }
            }
            Rect rect = new Rect(25f, y + 5f, 20f, 20f);
            this.PresetDropDown(rect);
            if ((Event.current.type == EventType.Used) && flag)
            {
                this.DoUpdateCurve(false);
                this.SendEvent("CurveChangeCompleted", true);
            }
            else if ((Event.current.type != EventType.Layout) && (Event.current.type != EventType.Repaint))
            {
                this.DoUpdateCurve(true);
            }
        }