Ejemplo n.º 1
0
 /// <summary>
 /// Create the view
 /// </summary>
 ///
 /// <param name="array">
 /// The array to view
 /// </param>
 public NativeArray2DDebugView(NativeArray2D <T> array)
 {
     m_Array = array;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Create the enumerator. It's initially just before the first
 /// element of both dimensions.
 /// </summary>
 ///
 /// <param name="array">
 /// Array to enumerate
 /// </param>
 public Enumerator(ref NativeArray2D <T> array)
 {
     m_Array  = array;
     m_Index0 = -1;
     m_Index1 = 0;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Check if this array points to the same native memory as another
 /// array.
 /// </summary>
 ///
 /// <param name="other">
 /// Array to check against.
 /// </param>
 ///
 /// <returns>
 /// If this array points to the same native memory as the given array.
 /// </returns>
 public bool Equals(NativeArray2D <T> other)
 {
     return(m_Buffer == other.m_Buffer &&
            m_Length0 == other.m_Length0 &&
            m_Length1 == other.m_Length1);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Copy the elements of this array to a native array
 /// </summary>
 ///
 /// <param name="array">
 /// Array to copy to. Must have the same dimensions
 /// as this array.
 /// </param>
 public void CopyTo(NativeArray2D <T> array)
 {
     Copy(this, array);
 }
Ejemplo n.º 5
0
 public void CopyFrom(NativeArray2D <T> array)
 {
     Copy(array, this);
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Create a copy of the given native array
 /// </summary>
 ///
 /// <param name="array">
 /// Native array to copy
 /// </param>
 ///
 /// <param name="allocator">
 /// Allocator to allocate native memory with. Must be valid as defined
 /// by <see cref="UnsafeUtility.IsValidAllocator"/>.
 /// </param>
 public NativeArray2D(NativeArray2D <T> array, Allocator allocator)
 {
     Allocate(array.Length0, array.Length1, allocator, out this);
     Copy(array, this);
 }