Example #1
0
        private void ElementInsertHandler(int index, BaseListElementData data)
        {
            var element = InstantiateElement(data, index);

            m_elements.Insert(index, element);

            TryUpdateElementsAnimation();

            OnElementsCountChanged.Call();
        }
Example #2
0
        private void Clear()
        {
            for (int i = 0; i < m_elements.Count; i++)
            {
                DestroyElement(m_elements[i]);
            }
            m_elements.Clear();

            OnElementsCountChanged.Call();
        }
Example #3
0
        private void ElementAddHandler(BaseListElementData data)
        {
            var element = InstantiateElement(data);

            m_elements.Add(element);

            TryUpdateElementsAnimation();

            OnElementsCountChanged.Call();
        }
Example #4
0
        private void ElementRemoveHandler(int index)
        {
            var element = m_elements[index];

            m_elements.RemoveAt(index);
            DestroyElement(element);

            TryUpdateElementsAnimation();

            OnElementsCountChanged.Call();
        }
Example #5
0
        private void RebuildList()
        {
            Clear();

            foreach (var data in property.value)
            {
                var element = InstantiateElement(data);
                m_elements.Add(element);
            }
            TryUpdateElementsAnimation();

            OnElementsCountChanged.Call();
        }