TryResize(int, NativeArrayOptions)
Attempts to set the length in bytes. Does nothing if the new length is invalid.
阅读时间1 分钟最后更新于 1 个月前
Definition
- Type: Method
- Namespace: Unity.Collections
- Assembly: UnityEngine.ManagedKernelModule
public bool TryResize(int newLength, NativeArrayOptions clearOptions = NativeArrayOptions.ClearMemory)
Parameters
The desired length.
Whether added or removed bytes should be cleared (zeroed). (Increasing the length adds bytes; decreasing the length removes bytes.)
Returns
Type | Description |
|---|---|
| bool | True if the new length is valid. |