Exemple #1
0
        /// <summary>
        /// Header Section. This overridden version displays the Add Object Field.
        /// </summary>
        /// <param name="property">The main SerializedProperty the list belongs to</param>
        /// <param name="listProperty">The list SerializedProperty that has the associated array attached.</param>
        /// <param name="label">Label provided to the main PropertyField</param>
        protected override void HeaderSection(GUIContent label)
        {
            T go = null;

            if ((go = AddObjectField(go)) != null)
            {
                int newItemIndex = ListProperty.arraySize;
                ListProperty.InsertArrayElementAtIndex(newItemIndex);
                ListProperty.GetArrayElementAtIndex(newItemIndex).objectReferenceValue = go;
            }
        }