Equals
Checks whether this reference identifies the same collection as another.
Read time 1 minuteLast updated 7 days ago
Definition
- Type: Method
- Namespace: Unity.Localization
- Assembly: UnityEngine.LocalizationRuntimeModule
Equals(TableReference)
Checks whether this reference identifies the same collection as another.
public bool Equals(TableReference other)
Parameters
The table reference to compare with this one.
Returns
Type | Description |
|---|---|
| bool | |
Remarks
References compare the way they resolve: a GUID reference compares by GUID and ignores any name text (the GUID wins during resolution too), and a name reference compares by ordinal name. References of different forms are not equal. Because TableReference.FromGuid canonicalizes its input, a dashed or differently cased GUID compares equal to its plain hex form. Empty references are equal to each other.
Compare a name reference against a GUID reference for the same collection.
Examples
using Unity.Localization;namespace Unity.Localization.Samples{ public class TableReferenceEqualsExample { public bool Run(string guid) { TableReference a = "UI Text"; TableReference b = TableReference.FromGuid(guid); 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 TableReference. Otherwise, defers to TableReference.Equals for value comparison.
falseobjCompare against a boxed reference.
Examples
using Unity.Localization;namespace Unity.Localization.Samples{ public class TableReferenceEqualsObjectExample { public bool Run(TableReference myReference) { object boxed = (TableReference)"UI Text"; return myReference.Equals(boxed); } }}