예제 #1
0
        public NativeSlice <U> SliceWithStride <U>(string offsetFieldName) where U : struct
        {
            if (!UnsafeUtility.IsFieldOfType <T>(offsetFieldName, typeof(U)))
            {
                throw new ArgumentException(string.Format("Field {0}.{1} does not exist or is not of type {2}", typeof(T).FullName, offsetFieldName, typeof(U).Name));
            }
            int offset = UnsafeUtility.OffsetOf <T>(offsetFieldName);

            return(this.SliceWithStride <U>(offset));
        }