コード例 #1
0
ファイル: NativeSlice.cs プロジェクト: yaoya/UnityDecompiled
        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));
        }