void DrawSetting(int index)
        {
            QualitySettingPostprocessProfileSwitch.QualitySettingEntry setting = m_Target.settings[index];

            GUILayout.FlexibleSpace();
            if (m_Target.settings.Length > 1 && GUILayout.Button("Remove", GUILayout.Width(64)))
            {
                Undo.RecordObject(m_Target,
                                  "Removed quality setting " + QualitySettings.names[m_Target.settings[index].minimumQualitySetting]);
                ArrayUtility.RemoveAt(ref m_Target.settings, index);
                EditorUtility.SetDirty(m_Target);
                GetRemainingQualitySetting();
                m_OpenedSettings = -1;
            }
            else
            {
                PostProcessProfile newProfile =
                    EditorGUILayout.ObjectField("Profile", setting.profile, typeof(PostProcessProfile), false) as PostProcessProfile;

                if (newProfile != setting.profile)
                {
                    Undo.RecordObject(m_Target, "Changed profile for setting " + QualitySettings.names[m_Target.settings[index].minimumQualitySetting]);
                    setting.profile = newProfile;
                    EditorUtility.SetDirty(m_Target);
                }

                PostProcessLayer.Antialiasing antiAliasing = (PostProcessLayer.Antialiasing)EditorGUILayout.EnumPopup("Antialiasing", setting.usedAntiAliasing);
                if (antiAliasing != setting.usedAntiAliasing)
                {
                    Undo.RecordObject(m_Target, "Changed antialiasing method for setting " + QualitySettings.names[m_Target.settings[index].minimumQualitySetting]);
                    setting.usedAntiAliasing = antiAliasing;
                    EditorUtility.SetDirty(m_Target);
                }
            }
        }
        public override void OnInspectorGUI()
        {
            if (remainingQuality.Length > 0)
            {
                int selected = EditorGUILayout.Popup("Add Quality Settings", -1, remainingQualityNames);
                if (selected != -1)
                {
                    Undo.RecordObject(target, "Added new Quality Setting in LayerCUllDistance");

                    QualitySettingPostprocessProfileSwitch.QualitySettingEntry newEntry =
                        new QualitySettingPostprocessProfileSwitch.QualitySettingEntry();

                    newEntry.minimumQualitySetting = remainingQuality[selected];

                    ArrayUtility.Add(ref m_Target.settings, newEntry);

                    EditorUtility.SetDirty(m_Target);

                    ArrayUtility.RemoveAt(ref remainingQualityNames, selected);
                    ArrayUtility.RemoveAt(ref remainingQuality, selected);
                }
            }

            for (int i = 0; i < m_Target.settings.Length; ++i)
            {
                bool opened = EditorGUILayout.Foldout(m_OpenedSettings == i,
                                                      "Quality : " + QualitySettings.names[m_Target.settings[i].minimumQualitySetting]);

                if (opened)
                {
                    m_OpenedSettings = i;
                    DrawSetting(i);
                }
                else if (m_OpenedSettings == i)
                {
                    m_OpenedSettings = -1;
                }
            }
        }