public static SharedNativeInt Create(int t) { unsafe { var current = new SharedNativeInt(); current.data = (int *)Marshal.AllocHGlobal(sizeof(int)); *current.data = t; return(current); } }
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); } }