/// <summary> /// Clears an object in the array, item will be null but still exist in the array. /// </summary> /// <param name="listProperty">The list SerializedProperty that has the associated array attached.</param> /// <param name="listItemProperty">The listItem SerializedProperty</param> /// <param name="index">Index of item</param> protected virtual void ClearItem(SerializedProperty listItemProperty, int index) { // Check value is not null, otherwise we will unset it if (listItemProperty.objectReferenceValue != null) { ListProperty.DeleteArrayElementAtIndex(index); } }
/// <summary> /// Deletes an item from the list property. /// <para>Can be overridden if not altering property directly or other logic is required.</para> /// </summary> /// <param name="listProperty"></param> /// <param name="listItemProperty"></param> /// <param name="index"></param> protected virtual void DeleteItem(SerializedProperty listItemProperty, int index) { ListProperty.DeleteArrayElementAtIndex(index); }