Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Equals

Checks whether this reference identifies the same entry as another.
Read time 1 minuteLast updated 6 days ago

Definition

  • Type: Method
  • Namespace: Unity.Localization
  • Assembly: UnityEngine.LocalizationRuntimeModule

Equals(TableEntryReference)

Checks whether this reference identifies the same entry as another.
public bool Equals(TableEntryReference other)

Parameters

The entry reference to compare with this one.

Returns

Type

Description

bool
true
if both references identify the same entry; otherwise,
false
.

Remarks

References compare the way they resolve: an id reference compares by key id and ignores any key text (the id wins during resolution too), and a name reference compares by ordinal key text. References of different forms are not equal. Empty references are equal to each other.
Compare two entry references for value equality.

Examples

using Unity.Localization;namespace Unity.Localization.Samples{ public class TableEntryReferenceEqualsExample { public bool Run() { TableEntryReference a = "Menu/Start"; TableEntryReference b = 12345L; return a.Equals(b); } }}

Equals(Object)

Checks whether this reference equals another object.
public override bool Equals(object obj)

Parameters

The object to compare with this reference.

Returns

Type

Description

bool
true
if
obj
is an entry reference that identifies the same entry; otherwise,
false
.

Remarks

Returns
false
when
obj
is not a TableEntryReference. Otherwise, defers to TableEntryReference.Equals for value comparison.
Compare against a boxed reference.

Examples

using Unity.Localization;namespace Unity.Localization.Samples{ public class TableEntryReferenceEqualsObjectExample { public bool Run(TableEntryReference entryReference) { object boxed = (TableEntryReference)"Menu/Start"; return entryReference.Equals(boxed); } }}