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 | |
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 | |
Remarks
Returns when is not a TableEntryReference. Otherwise, defers to TableEntryReference.Equals for value comparison.
falseobjCompare 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); } }}