Version: Unity 6.7 Alpha (6000.7)
LanguageEnglish
  • C#

TableReference.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(TableReference other);

Parameters

Parameter Description
other The table reference to compare with this one.

Returns

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

Description

Checks whether this reference identifies the same collection as another.

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.

<para>Compare a name reference against a GUID reference for the same collection.</para>

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); } } }

Declaration

public bool Equals(Object obj);

Parameters

Parameter Description
obj The object to compare with this reference.

Returns

bool true if obj is a table reference that identifies the same collection; otherwise, false.

Description

Checks whether this reference equals another object.

Returns false when obj is not a TableReference. Otherwise, defers to TableReference.Equals for value comparison.

<para>Compare against a boxed reference.</para>

using Unity.Localization;

namespace Unity.Localization.Samples { public class TableReferenceEqualsObjectExample { public bool Run(TableReference myReference) { object boxed = (TableReference)"UI Text"; return myReference.Equals(boxed); } } }