コード例 #1
0
        public static SharedNativeInt Create(int t)
        {
            unsafe
            {
                var current = new SharedNativeInt();
                current.data = (int *)Marshal.AllocHGlobal(sizeof(int));
                *current.data = t;

                return(current);
            }
        }
コード例 #2
0
        public static SharedNativeInt Create(int t, Allocator allocator)
        {
            unsafe {
                var current = new SharedNativeInt();
                current._allocator = allocator;
                current.data       = (int *)MemoryUtilities.Alloc(sizeof(int), allocator);
                *current.data = t;

                return(current);
            }
        }