Ejemplo n.º 1
0
        public T ReadElement <T>(int index) where T : unmanaged
        {
#if DEBUG || ENABLE_UNITY_COLLECTIONS_CHECKS
            RequireCreated();
            RequireIndexInBounds(index);
#endif
            return(UnsafeCollectionUtility.ReadArrayElement <T>(Ptr, index));
        }
Ejemplo n.º 2
0
 public static int IndexOf <T, U>(void *ptr, int length, U value) where T : unmanaged, IEquatable <U>
 {
     for (int i = 0; i != length; i++)
     {
         if (UnsafeCollectionUtility.ReadArrayElement <T>(ptr, i).Equals(value))
         {
             return(i);
         }
     }
     return(-1);
 }