/// <summary>
        /// Creates a new list with the specified initial capacity and type of memory allocation.
        /// </summary>
        /// <param name="initialCapacity">The initial capacity of the list. If the list grows larger than its capacity,
        /// the internal array is copied to a new, larger array.</param>
        /// <param name="allocator">A member of the
        /// [Unity.Collections.Allocator](https://docs.unity3d.com/ScriptReference/Unity.Collections.Allocator.html) enumeration.</param>
        /// <param name="options">Memory should be cleared on allocation or left uninitialized.</param>
        /// <returns>New initialized container.</returns>
        public static UnsafePtrList *Create(int initialCapacity, Allocator allocator, NativeArrayOptions options = NativeArrayOptions.UninitializedMemory)
        {
            UnsafePtrList *listData = AllocatorManager.Allocate <UnsafePtrList>(allocator);

            *listData = new UnsafePtrList(initialCapacity, allocator, options);
            return(listData);
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="ptr"></param>
        /// <param name="length"></param>
        /// <returns>New initialized container.</returns>
        public static UnsafePtrList *Create(void **ptr, int length)
        {
            UnsafePtrList *listData = AllocatorManager.Allocate <UnsafePtrList>(AllocatorManager.Persistent);

            *listData = new UnsafePtrList(ptr, length);
            return(listData);
        }
 /// <summary>
 /// Adds elements from a list to this list.
 /// </summary>
 /// <param name="list">Other container to copy elements from.</param>
 /// <remarks>
 /// If the list has reached its current capacity, internal array won't be resized, and exception will be thrown.
 /// </remarks>
 public void AddRangeNoResize(UnsafePtrList list)
 {
     this.ListData().AddRangeNoResize <IntPtr>(list.Ptr, list.Length);
 }
Ejemplo n.º 4
0
 public void Append(UnsafePtrList src)
 {
     GetUnsafeList().Append <IntPtr>(src.GetUnsafeList());
 }
Ejemplo n.º 5
0
 public UnsafePtrListDebugView(UnsafePtrList UnsafePtrList)
 {
     m_UnsafePtrList = UnsafePtrList;
 }