Version: 2019.4

UnsafeUtility

class in Unity.Collections.LowLevel.Unsafe

マニュアルに切り替える

説明

Unsafe utility class.

Static 関数

AddressOfThe memory address of the struct.
AlignOfMinimum alignment of a struct.
CopyObjectAddressToPtrAssigns an Object reference to a struct or pinned class. See Also: UnsafeUtility.PinGCObjectAndGetAddress.
CopyPtrToStructureCopies sizeof(T) bytes from ptr to output.
CopyStructureToPtrCopies sizeof(T) bytes from input to ptr.
EnumToIntReturn integer representation of enum value without boxing.
FreeFree memory.
GetFieldOffsetReturns the offset of the field relative struct or class it is contained in.
IsBlittableReturns whether the struct is blittable.
IsUnmanagedReturns whether the struct or type is unmanaged. An unmanaged type contains no managed fields, and can be freely copied in memory.
IsValidAllocatorReturns true if the allocator label is valid and can be used to allocate or deallocate memory.
IsValidNativeContainerElementTypeReturns whether the type is acceptable as an element type in native containers.
MallocAllocate memory.
MemClearClear memory.
MemCmpChecks to see whether two memory regions are identical or not by comparing a specified memory region in the first given memory buffer with the same region in the second given memory buffer.
MemCpyCopy memory.
MemCpyReplicateCopy memory and replicate.
MemCpyStrideSimilar to UnsafeUtility.MemCpy but can skip bytes via desinationStride and sourceStride.
MemMoveMove memory.
MemSetSet memory to specified value.
PinGCArrayAndGetDataAddressKeeps a strong GC reference to the object and pins it. The object is guranteed to not move its memory location in a moving GC. Returns the address of the first element of the array.See Also: UnsafeUtility.ReleaseGCObject.
PinGCObjectAndGetAddressKeeps a strong GC reference to the object and pins it. The object is guranteed to not move its memory location in a moving GC. Returns the address of the memory location of the object.See Also: UnsafeUtility.ReleaseGCObject.
ReadArrayElementRead array element.
ReadArrayElementWithStrideRead array element with stride.
ReleaseGCObjectReleases a GC Object Handle, previously aquired by UnsafeUtility.PinGCObjectAndGetAddress.
SizeOfSize of struct.
WriteArrayElementWrite array element.
WriteArrayElementWithStrideWrite array element with stride.