private void DrawNonEditableSection(MM_DataSection section, ref bool fold)
        {
            if (!GUILayoutElements.DrawHeader(
                    "Section :  " + section.sectionName,
                    GUIResources.GetMediumHeaderStyle_SM(),
                    GUIResources.GetLightHeaderStyle_SM(),
                    ref fold
                    ))
            {
                return;
            }
            for (int intervalIndex = 0; intervalIndex < section.timeIntervals.Count; intervalIndex++)
            {
                float min = section.timeIntervals[intervalIndex].x;
                float max = section.timeIntervals[intervalIndex].y;

                GUILayout.BeginHorizontal();
                min = EditorGUILayout.FloatField(Mathf.Clamp(min, 0f, max), GUILayout.Width(60));
                EditorGUILayout.MinMaxSlider(ref min, ref max, 0f, data.animationLength);
                max = EditorGUILayout.FloatField(Mathf.Clamp(max, min, data.animationLength), GUILayout.Width(60));

                min = (float)Math.Round(min, 4);
                max = (float)Math.Round(max, 4);

                section.SetTimeIntervalWithCheck(intervalIndex, new float2(min, max));

                if (GUILayout.Button("X", GUILayout.Width(20)))
                {
                    section.timeIntervals.RemoveAt(intervalIndex);
                    intervalIndex = Mathf.Clamp(intervalIndex - 1, 0, int.MaxValue);
                }
                GUILayout.EndHorizontal();
            }

            GUILayout.BeginHorizontal();
            if (GUILayout.Button("Add interval"))
            {
                section.timeIntervals.Add(new float2(0f, data.animationLength));
            }
            if (GUILayout.Button("Clear"))
            {
                section.timeIntervals.Clear();
            }
            GUILayout.EndHorizontal();
        }
        private void DrawIntervalsTable(MM_DataSection section, int sectionIndex)
        {
            if (section.timeIntervals.Count == 0)
            {
                for (int frameIndex = 0; frameIndex < data.numberOfFrames; frameIndex++)
                {
                    FrameData buffor = data[frameIndex];

                    buffor.sections.SetSection(sectionIndex, false);

                    data.frames[frameIndex] = buffor;
                }
            }
            for (int intervalIndex = 0; intervalIndex < section.timeIntervals.Count; intervalIndex++)
            {
                float min = section.timeIntervals[intervalIndex].x;
                float max = section.timeIntervals[intervalIndex].y;

                GUILayout.BeginHorizontal();
                min = EditorGUILayout.FloatField(Mathf.Clamp(min, 0f, max), GUILayout.Width(60));
                EditorGUILayout.MinMaxSlider(ref min, ref max, 0f, data.animationLength);
                max = EditorGUILayout.FloatField(Mathf.Clamp(max, min, data.animationLength), GUILayout.Width(60));

                min = (float)Math.Round(min, 4);
                max = (float)Math.Round(max, 4);

                if (section.SetTimeIntervalWithCheck(intervalIndex, new float2(min, max)))
                {
                    for (int frameIndex = 0; frameIndex < data.numberOfFrames; frameIndex++)
                    {
                        ChangeSectionInFrame(frameIndex, sectionIndex);
                    }
                }

                if (GUILayout.Button("X", GUILayout.Width(20)))
                {
                    section.timeIntervals.RemoveAt(intervalIndex);
                    intervalIndex = Mathf.Clamp(intervalIndex - 1, 0, int.MaxValue);

                    for (int frameIndex = 0; frameIndex < data.numberOfFrames; frameIndex++)
                    {
                        ChangeSectionInFrame(frameIndex, sectionIndex);
                    }
                }
                GUILayout.EndHorizontal();
            }

            GUILayout.BeginHorizontal();
            if (GUILayout.Button("Add interval"))
            {
                if (section.timeIntervals.Count == 0)
                {
                    section.timeIntervals.Add(new float2(0f, data.animationLength));
                    for (int frameIndex = 0; frameIndex < data.numberOfFrames; frameIndex++)
                    {
                        ChangeSectionInFrame(frameIndex, sectionIndex);
                    }
                }
                else
                {
                    section.timeIntervals.Add(section.timeIntervals[section.timeIntervals.Count - 1]);
                }
            }
            if (GUILayout.Button("Clear"))
            {
                section.timeIntervals.Clear();
            }
            GUILayout.EndHorizontal();
        }