/// <inheritdoc/>
            protected internal override void CloneElement(int index)
            {
                SerializableList serializableList = property.GetList();

                if (index >= 0 && index < list.Count)
                {
                    list.Add(SerializableUtility.Clone(serializableList.GetProperty(index).GetValue <object>()));
                }

                numElements = list.Count;
            }
Exemple #2
0
        /// <summary>
        /// Registers a set of rows for all entries of the provided list.
        /// </summary>
        /// <param name="parent">Parent foldout row to which to append the new elements.</param>
        /// <param name="serializableList">List whose fields to display.</param>
        private void AddListRows(Element parent, SerializableList serializableList)
        {
            List <Element> elements = new List <Element>();

            int length = serializableList.GetLength();

            for (int i = 0; i < length; i++)
            {
                string name         = "[" + i + "]";
                string propertyPath = parent.path + name;

                Element element;
                if (AddPropertyRow(parent, name, propertyPath, serializableList.GetProperty(i), out element))
                {
                    elements.Add(element);
                }
            }

            parent.children = elements.ToArray();
        }
            /// <inheritdoc/>
            protected internal override object GetValue(int seqIndex)
            {
                SerializableList list = property.GetList();

                return(list.GetProperty(seqIndex));
            }