Unsafe Utility 类。
AddressOf | 此结构的内存地址。 |
AlignOf | 结构的最小对齐单位。 |
CopyObjectAddressToPtr | 分配对结构或固定类的对象引用。另请参阅:UnsafeUtility.PinGCObjectAndGetAddress。 |
CopyPtrToStructure | 从 ptr 向 output 复制 sizeof(T) 个字节。 |
CopyStructureToPtr | 从 input 向 ptr 复制 sizeof(T) 个字节。 |
Free | 可用内存。 |
GetFieldOffset | 返回字段相对于结构或其所在类的偏移。 |
IsBlittable | 返回此结构是否可直接复制到本机结构中。 |
IsValidAllocator | 如果分配器标签有效并且可用来分配或取消分配内存,则返回 true。 |
Malloc | 分配内存。 |
MemClear | 清除内存。 |
MemCmp | 通过将第一个给定内存缓冲区中的指定内存区域与第二个给定内存缓冲区中的相同区域进行比较,检查两个内存区域是否相同。 |
MemCpy | 复制内存。 |
MemCpyReplicate | 复制内存。 |
MemCpyStride | 与 UnsafeUtility.MemCpy 类似,但可以通过 desinationStride 和 sourceStride 跳过字节。 |
MemMove | 移动内存。 |
PinGCArrayAndGetDataAddress | 保持对该对象的强 GC 引用并将其固定。保证对象在移动 GC 中的内存位置不会移动。返回数组第一个元素的地址。另请参阅:UnsafeUtility.ReleaseGCObject。 |
PinGCObjectAndGetAddress | 保持对该对象的强 GC 引用并将其固定。保证对象在移动 GC 中的内存位置不会移动。返回该对象的内存位置地址。另请参阅:UnsafeUtility.ReleaseGCObject。 |
ReadArrayElement | 读取数组元素。 |
ReadArrayElementWithStride | 使用步幅读取数组元素。 |
ReleaseGCObject | 释放之前由 UnsafeUtility.PinGCObjectAndGetAddress 获取的 GC 对象句柄。 |
SizeOf | 结构的大小。 |
WriteArrayElement | 写入数组元素。 |
WriteArrayElementWithStride | 使用步幅写入数组元素。 |
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.