Version: Unity 6.7 Alpha (6000.7)
LanguageEnglish
  • C#

Resources.EntityIdsToValidArray

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public static void EntityIdsToValidArray(NativeArray<EntityId> entityIDs, NativeArray<bool> validArray);

Parameters

Parameter Description
entityIDs The EntityIDs of the Object instances to check.
validArray The array that receives the results. The method sets each element to true if the EntityID at the same index in entityIDs corresponds to a valid Object, otherwise false. Must be the same length as entityIDs.

Description

Checks whether each EntityID in a NativeArray<T0> corresponds to a valid Object in memory, and writes the result for each to a given NativeArray<T0>.

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 EntityIDs at once. Both arrays must be initialized and the same length, otherwise the method throws an ArgumentException.


Declaration

public static void EntityIdsToValidArray(ReadOnlySpan<EntityId> entityIds, Span<bool> validArray);

Parameters

Parameter Description
entityIds The EntityIDs of the Object instances to check.
validArray The span that receives the results. The method sets each element to true if the EntityID at the same index in entityIds corresponds to a valid Object, otherwise false. Must be the same length as entityIds.

Description

Checks whether each EntityID in an array corresponds to a valid Object in memory, and writes the result for each to a given array.

This is similar to Resources.EntityIdIsValid but checks several EntityIDs at once. entityIds and validArray must be the same length, otherwise the method throws an ArgumentException.