Пример #1
0
            public NativeStaticArrayHead ToHead()
            {
                var head = new NativeStaticArrayHead()
                {
                    TypePositions = NativeLists.ToArray(Allocator.Persistent),
                    Size          = offset
                };

                NativeLists.Dispose();
                return(head);
            }
Пример #2
0
        public static NativeStaticArray Create(ref NativeStaticArrayHead head, int size)
        {
            var array = new NativeStaticArray
            {
                head     = head,
                Capacity = size,
                data     = (byte *)UnsafeUtility.Malloc(head.Size * size, 4, Allocator.Persistent),
                _idle    = new NativeQueue <int>(Allocator.Persistent)
            };

            return(array);
        }