Version: 2018.1

UnsafeUtility

class in Unity.Collections.LowLevel.Unsafe

Switch to Manual

Description

Unsafe utility class.

Static Functions

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.
FreeFree memory.
GetFieldOffsetReturns the offset of the field relative struct or class it is contained in.
IsBlittableReturns whether the struct is blittable.
IsValidAllocatorReturns true if the allocator label is valid and can be used to allocate or deallocate memory.
MallocAllocate memory.
MemClearClear memory.
MemCpyCopy memory.
MemCpyReplicateCopy memory and replicate.
MemCpyStrideSimilar to UnsafeUtility.MemCpy but can skip bytes via desinationStride and sourceStride.
MemMoveMove memory.
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.
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961