Documentation

Unity Engine


Unity Engine


Equals

TypeIndex instances are equal if they refer to the same component type instance.
Read time 1 minuteLast updated 3 days ago

Definition

  • Type: Method
  • Namespace: Unity.Entities
  • Assembly: UnityEngine.EntitiesModule

Equals(Object)

TypeIndex instances are equal if they refer to the same component type instance.
public override bool Equals(object compare)

Parameters

compare

The object to compare to this TypeIndex.

Returns

Type

Description

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

Remarks

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.

Equals(TypeIndex)

TypeIndex instances are equal if they refer to the same component type instance.
public bool Equals(TypeIndex typeIndex)

Parameters

typeIndex

The other TypeIndex.

Returns

Type

Description

boolTrue, if the TypeIndex instances are equal.

Remarks

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.