Version: Unity 7.0 Alpha (7000.0)
LanguageEnglish
  • C#

TypeIndex.Equals

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 bool Equals(Object compare);

Parameters

Parameter Description
compare The object to compare to this TypeIndex.

Returns

bool True, if the compare parameter contains a TypeIndex object equal to this TypeIndex instance.

Description

TypeIndex instances are equal if they refer to the same component type instance.

Note that two TypeIndex for the same Component Type may not always be equal. For example, a type inheriting from IComponentData could be used as a Chunk Component in one Archetype but not in another. If those two TypeIndices were compared they would not match even though they are for the same System.Type.


Declaration

public bool Equals(TypeIndex typeIndex);

Parameters

Parameter Description
typeIndex The other TypeIndex.

Returns

bool True, if the TypeIndex instances are equal.

Description

TypeIndex instances are equal if they refer to the same component type instance.

Note that two for the TypeIndex same Component Type may not always be equal. For example, a type inheriting from IComponentData could be used as a Chunk Component in one Archetype but not in another. If those two TypeIndices were compared they would not match even though they are for the same System.Type.