/// <summary> Adds an element to an array property at the beginning and returns the property that was added. </summary> /// <param name="property"> the array property </param> /// <returns> the SerializedProperty pointing to the array element </returns> /// <exception cref="ArgumentNullException"> <paramref name="property" /> is null. </exception> /// <exception cref="ArgumentException"> <paramref name="property" /> is not an array property. </exception> public static SerializedProperty Prepend(this SerializedProperty property) { return(property.AddElementAtIndex(0)); }
/// <summary> Adds an element to an array property at the end and returns the property that was added. </summary> /// <param name="property"> the array property </param> /// <returns> the SerializedProperty pointing to the array element </returns> /// <exception cref="ArgumentNullException"> <paramref name="property" /> is null. </exception> /// <exception cref="ArgumentException"> <paramref name="property" /> is not an array property. </exception> public static SerializedProperty Append(this SerializedProperty property) { return(property.AddElementAtIndex(property.arraySize)); }