Ejemplo n.º 1
0
        public void To_NativeArray_Zero()
        {
            var array = new BlitableArray <float>();

            NativeArray <float> nativeArray = array.ToNativeArray(Allocator.Temp);

            AreEqual(array.Length, nativeArray.Length);

            for (int i = 0; i < array.Length; i++)
            {
                AreEqual(array[i], nativeArray[i]);
            }

            nativeArray.Dispose();
            array.Dispose();
        }
Ejemplo n.º 2
0
        public void To_NativeArray_Call()
        {
            var managedArray = Enumerable.Range(0, 25).Select(x => (float)x).ToArray();
            var array        = new BlitableArray <float>();

            array.Allocate(managedArray, Allocator.Temp);
            NativeArray <float> nativeArray = array.ToNativeArray(Allocator.Temp);

            AreEqual(array.Length, nativeArray.Length);

            for (int i = 0; i < array.Length; i++)
            {
                AreEqual(array[i], nativeArray[i]);
            }

            nativeArray.Dispose();
            array.Dispose();
        }