internal Enumerator(TSource *ptr, long length, ulong gcHandle) { this.ptr = ptr; this.length = length; this.gcHandle = gcHandle; this.index = -1; }
internal Enumerator(TSource start, long count, TAction action, Allocator allocator) { this.current = UnsafeUtilityEx.Malloc <TSource>(1, allocator); *this.current = start; this.count = count; this.index = -1; this.action = action; this.allocator = allocator; }
public NativeEnumerable(TSource *ptr, long length) { if (length <= 0 || ptr == null) { this = default; return; } this.Ptr = ptr; this.Length = length; }
public NativeEnumerable(NativeArray <TSource> array) { if (array.IsCreated) { this.Ptr = array.GetPointer(); this.Length = array.Length; } else { this.Ptr = null; this.Length = 0; } }
public NativeEnumerable(NativeArray <TSource> array, long offset, long length) { if (array.IsCreated && length > 0) { if (offset >= 0) { this.Ptr = array.GetPointer() + offset; this.Length = length; } else { this.Ptr = array.GetPointer(); this.Length = length + offset; } } else { this.Ptr = null; this.Length = 0; } }