EntityIdsToValidArray
Checks whether each EntityID in a NativeArray<T> corresponds to a valid Object in memory, and writes the result for each to a given NativeArray<T>.
阅读时间2 分钟最后更新于 1 个月前
Definition
- Type: Method
- Namespace: UnityEngine
- Assembly: UnityEngine.CoreModule
EntityIdsToValidArray(NativeArray<EntityId>, NativeArray<bool>)
Checks whether each in a NativeArray<T> corresponds to a valid Object in memory, and writes the result for each to a given NativeArray<T>.
EntityIDpublic static void EntityIdsToValidArray(NativeArray<EntityId> entityIDs, NativeArray<bool> validArray)
Parameters
Remarks
It can be useful to call this method to determine if an Object might have been deleted or isn't loaded into memory yet. This is similar to Resources.EntityIdIsValid but checks several s at once. Both arrays must be initialized and the same length, otherwise the method throws an .
EntityIDArgumentExceptionEntityIdsToValidArray(ReadOnlySpan<EntityId>, Span<bool>)
Checks whether each in an array corresponds to a valid Object in memory, and writes the result for each to a given array.
EntityIDpublic static void EntityIdsToValidArray(ReadOnlySpan<EntityId> entityIds, Span<bool> validArray)
Parameters
Remarks
This is similar to Resources.EntityIdIsValid but checks several s at once. and must be the same length, otherwise the method throws an .
EntityIDentityIdsvalidArrayArgumentException