void RemoveIconDataElement(ReorderableList list)
        {
            serializedObject.Update();

            manager.RemoveDrawableResource(list.index);

            OnChange(list);
        }
        private void InitReorderableList()
        {
            m_ReorderableList = new ReorderableList(m_SettingsManagerObject, m_DrawableResources, false, false, true, true);
            m_ReorderableList.elementHeight         = k_SlotSize + k_IconSpacing;
            m_ReorderableList.showDefaultBackground = true;
            m_ReorderableList.headerHeight          = 1;

            // Register all the necessary callbacks on ReorderableList.
            m_ReorderableList.onAddCallback = (list) =>
            {
                Undo.RegisterCompleteObjectUndo(m_SettingsManager, "Add a new icon element");
                m_SettingsManager.AddDrawableResource(string.Format("icon_{0}", m_SettingsManager.DrawableResources.Count), null, NotificationIconType.Small);
            };

            m_ReorderableList.onRemoveCallback = (list) =>
            {
                m_SettingsManager.RemoveDrawableResource(list.index);
            };

            m_ReorderableList.onCanAddCallback = (list) =>
            {
                var trackedAssets = m_SettingsManager.DrawableResources;
                if (trackedAssets.Count <= 0)
                {
                    return(true);
                }

                return(trackedAssets.All(asset => asset.Initialized()));
            };

            m_ReorderableList.drawElementCallback = (rect, index, active, focused) => DrawIconDataElement(rect, index, active, focused);

            m_ReorderableList.drawElementBackgroundCallback = (rect, index, active, focused) =>
            {
                if (Event.current.type != EventType.Repaint)
                {
                    return;
                }

                var background = index % 2 == 0 ? NotificationStyles.k_EvenRow : NotificationStyles.k_OddRow;
                background.Draw(rect, false, false, false, false);

                ReorderableList.defaultBehaviours.DrawElementBackground(rect, index, active, focused, true);
            };

            m_ReorderableList.elementHeightCallback = (index) =>
            {
                var data = GetDrawableResource(index);
                if (data == null)
                {
                    return(k_SlotSize);
                }

                return(m_ReorderableList.elementHeight + (data.Asset != null && !data.IsValid ? k_SlotSize : 0));
            };
        }