/// <summary> /// Searches for the specified element in native array. /// </summary> /// <typeparam name="T">The type of values in the array.</typeparam> /// <typeparam name="U">The value type.</typeparam> /// <param name="array">Array to perform search.</param> /// <param name="value">The value to locate.</param> /// <returns>The zero-based index of the first occurrence element if found, otherwise returns -1.</returns> public static int IndexOf <T, U>(this NativeArray <T> array, U value) where T : struct, IEquatable <U> { return(IndexOf <T, U>(array.GetUnsafeReadOnlyPtr(), array.Length, value)); }
/// <summary> /// Adds the elements of a NativeArray to this list. /// </summary> /// <param name="elements">The items to add.</param> public void AddRange(NativeArray <T> elements) { AddRange(elements.GetUnsafeReadOnlyPtr(), elements.Length); }